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/bgen | |
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/bgen')
-rw-r--r-- | Tools/bgen/bgen/scantools.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Tools/bgen/bgen/scantools.py b/Tools/bgen/bgen/scantools.py index d809a65..bae29a0 100644 --- a/Tools/bgen/bgen/scantools.py +++ b/Tools/bgen/bgen/scantools.py @@ -293,7 +293,7 @@ if missing: raise "Missing Types" def openrepairfile(self, filename = "REPAIR"): try: return open(filename, "rU") - except IOError, msg: + except IOError as msg: print repr(filename), ":", msg print "Cannot open repair file -- assume no repair needed" return None @@ -419,7 +419,7 @@ if missing: raise "Missing Types" def openoutput(self, filename): try: file = open(filename, 'w') - except IOError, arg: + except IOError as arg: raise IOError, (filename, arg) self.setfiletype(filename) return file @@ -460,7 +460,7 @@ if missing: raise "Missing Types" # If not on the path, or absolute, try default open() try: return open(filename, 'rU') - except IOError, arg: + except IOError as arg: raise IOError, (arg, filename) def getline(self): |