diff options
author | Guido van Rossum <guido@python.org> | 2007-01-10 16:19:56 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-01-10 16:19:56 +0000 |
commit | b940e113bf90ff71b0ef57414ea2beea9d2a4bc0 (patch) | |
tree | 0b9ea19eba1e665dac95126c3140ac2bc36326ad /Tools/scripts/pysource.py | |
parent | 893523e80a2003d4a630aafb84ba016e0070cbbd (diff) | |
download | cpython-git-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.tar.gz |
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/scripts/pysource.py')
-rw-r--r-- | Tools/scripts/pysource.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Tools/scripts/pysource.py b/Tools/scripts/pysource.py index 71e0ded9cf..98a78f0b46 100644 --- a/Tools/scripts/pysource.py +++ b/Tools/scripts/pysource.py @@ -33,7 +33,7 @@ def print_debug(msg): def _open(fullpath): try: size = os.stat(fullpath).st_size - except OSError, err: # Permission denied - ignore the file + except OSError as err: # Permission denied - ignore the file print_debug("%s: permission denied: %s" % (fullpath, err)) return None @@ -43,7 +43,7 @@ def _open(fullpath): try: return open(fullpath, 'rU') - except IOError, err: # Access denied, or a special file - ignore it + except IOError as err: # Access denied, or a special file - ignore it print_debug("%s: access denied: %s" % (fullpath, err)) return None @@ -81,7 +81,7 @@ def can_be_compiled(fullpath): try: compile(code, fullpath, "exec") - except Exception, err: + except Exception as err: print_debug("%s: cannot compile: %s" % (fullpath, err)) return False |