summaryrefslogtreecommitdiff
path: root/Tools/scripts/pysource.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-01-10 16:19:56 +0000
committerGuido van Rossum <guido@python.org>2007-01-10 16:19:56 +0000
commitb940e113bf90ff71b0ef57414ea2beea9d2a4bc0 (patch)
tree0b9ea19eba1e665dac95126c3140ac2bc36326ad /Tools/scripts/pysource.py
parent893523e80a2003d4a630aafb84ba016e0070cbbd (diff)
downloadcpython-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.py6
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