diff options
author | Guido van Rossum <guido@python.org> | 2007-01-10 16:19:56 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-01-10 16:19:56 (GMT) |
commit | b940e113bf90ff71b0ef57414ea2beea9d2a4bc0 (patch) | |
tree | 0b9ea19eba1e665dac95126c3140ac2bc36326ad /Tools/freeze | |
parent | 893523e80a2003d4a630aafb84ba016e0070cbbd (diff) | |
download | cpython-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.zip cpython-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.tar.gz cpython-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.tar.bz2 |
SF patch 1631942 by Collin Winter:
(a) "except E, V" -> "except E as V"
(b) V is now limited to a simple name (local variable)
(c) V is now deleted at the end of the except block
Diffstat (limited to 'Tools/freeze')
-rw-r--r-- | Tools/freeze/checkextensions_win32.py | 2 | ||||
-rwxr-xr-x | Tools/freeze/freeze.py | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Tools/freeze/checkextensions_win32.py b/Tools/freeze/checkextensions_win32.py index a198ecf..ba3853c 100644 --- a/Tools/freeze/checkextensions_win32.py +++ b/Tools/freeze/checkextensions_win32.py @@ -131,7 +131,7 @@ def parse_dsp(dsp): dsp_path, dsp_name = os.path.split(dsp) try: lines = open(dsp, "r").readlines() - except IOError, msg: + except IOError as msg: sys.stderr.write("%s: %s\n" % (dsp, msg)) return None for line in lines: diff --git a/Tools/freeze/freeze.py b/Tools/freeze/freeze.py index 3e6a580..786d53a 100755 --- a/Tools/freeze/freeze.py +++ b/Tools/freeze/freeze.py @@ -145,7 +145,7 @@ def main(): if sys.argv[pos] == '-i': try: options = open(sys.argv[pos+1]).read().split() - except IOError, why: + except IOError as why: usage("File name '%s' specified with the -i option " "can not be read - %s" % (sys.argv[pos+1], why) ) # Replace the '-i' and the filename with the read params. @@ -156,7 +156,7 @@ def main(): # Now parse the command line with the extras inserted. try: opts, args = getopt.getopt(sys.argv[1:], 'r:a:dEe:hmo:p:P:qs:wX:x:l:') - except getopt.error, msg: + except getopt.error as msg: usage('getopt error: ' + str(msg)) # proces option arguments @@ -311,7 +311,7 @@ def main(): try: os.mkdir(odir) print "Created output directory", odir - except os.error, msg: + except os.error as msg: usage('%s: mkdir failed (%s)' % (odir, str(msg))) base = '' if odir: @@ -333,7 +333,7 @@ def main(): try: custom_entry_point, python_entry_is_main = \ winmakemakefile.get_custom_entry_point(subsystem) - except ValueError, why: + except ValueError as why: usage(why) |