Mercurial > cpython-lru_cache-weakref
diff Tools/scripts/checkappend.py @ 40587:6b18a095c2e7
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
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 10 Jan 2007 16:19:56 +0000 |
| parents | 71a294bd7950 |
| children | 46625e6122e9 |
line wrap: on
line diff
--- a/Tools/scripts/checkappend.py Wed Jan 10 01:29:06 2007 +0000 +++ b/Tools/scripts/checkappend.py Wed Jan 10 16:19:56 2007 +0000 @@ -50,7 +50,7 @@ global verbose try: opts, args = getopt.getopt(sys.argv[1:], "v") - except getopt.error, msg: + except getopt.error as msg: errprint(str(msg) + "\n\n" + __doc__) return for opt, optarg in opts: @@ -77,7 +77,7 @@ try: f = open(file) - except IOError, msg: + except IOError as msg: errprint("%r: I/O Error: %s" % (file, msg)) return @@ -104,7 +104,7 @@ def run(self): try: tokenize.tokenize(self.file.readline, self.tokeneater) - except tokenize.TokenError, msg: + except tokenize.TokenError as msg: errprint("%r: Token Error: %s" % (self.fname, msg)) self.nerrors = self.nerrors + 1 return self.nerrors == 0
