comparison roundup/init.py @ 5248:198b6e810c67

Use Python-3-compatible 'as' syntax for except statements Many raise statements near these are also fixed. So are two ivorrect file encoding marks ('utf8'->'utf-8').
author Eric S. Raymond <esr@thyrsus.com>
date Thu, 24 Aug 2017 22:21:37 -0400
parents 5251e97b1de0
children 64b05e24dbd8
comparison
equal deleted inserted replaced
5247:7f00a47b3559 5248:198b6e810c67
41 41
42 # Prevent 'hidden' files (those starting with '.') from being considered. 42 # Prevent 'hidden' files (those starting with '.') from being considered.
43 names = [f for f in os.listdir(src) if not f.startswith('.')] 43 names = [f for f in os.listdir(src) if not f.startswith('.')]
44 try: 44 try:
45 os.mkdir(dst) 45 os.mkdir(dst)
46 except OSError, error: 46 except OSError as error:
47 if error.errno != errno.EEXIST: raise 47 if error.errno != errno.EEXIST: raise
48 for name in names: 48 for name in names:
49 srcname = os.path.join(src, name) 49 srcname = os.path.join(src, name)
50 dstname = os.path.join(dst, name) 50 dstname = os.path.join(dst, name)
51 if symlinks and os.path.islink(srcname): 51 if symlinks and os.path.islink(srcname):

Roundup Issue Tracker: http://roundup-tracker.org/