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 /Lib/tabnanny.py | |
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 'Lib/tabnanny.py')
-rwxr-xr-x | Lib/tabnanny.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/tabnanny.py b/Lib/tabnanny.py index 76665ac..1d2c6db 100755 --- a/Lib/tabnanny.py +++ b/Lib/tabnanny.py @@ -43,7 +43,7 @@ def main(): global verbose, filename_only try: opts, args = getopt.getopt(sys.argv[1:], "qv") - except getopt.error, msg: + except getopt.error as msg: errprint(msg) return for o, a in opts: @@ -95,7 +95,7 @@ def check(file): try: f = open(file) - except IOError, msg: + except IOError as msg: errprint("%r: I/O Error: %s" % (file, msg)) return @@ -105,15 +105,15 @@ def check(file): try: process_tokens(tokenize.generate_tokens(f.readline)) - except tokenize.TokenError, msg: + except tokenize.TokenError as msg: errprint("%r: Token Error: %s" % (file, msg)) return - except IndentationError, msg: + except IndentationError as msg: errprint("%r: Indentation Error: %s" % (file, msg)) return - except NannyNag, nag: + except NannyNag as nag: badline = nag.get_lineno() line = nag.get_line() if verbose: |