aboutsummaryrefslogtreecommitdiff
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 /Lib/token.py
parentNews about removal of the sets module. (diff)
downloadcpython-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.tar.gz
cpython-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.tar.bz2
cpython-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.zip
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/token.py')
-rwxr-xr-xLib/token.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/token.py b/Lib/token.py
index 2770cfd6757..477827ac0aa 100755
--- a/Lib/token.py
+++ b/Lib/token.py
@@ -93,7 +93,7 @@ def main():
outFileName = args[1]
try:
fp = open(inFileName)
- except IOError, err:
+ except IOError as err:
sys.stdout.write("I/O error: %s\n" % str(err))
sys.exit(1)
lines = fp.read().split("\n")
@@ -113,7 +113,7 @@ def main():
# load the output skeleton from the target:
try:
fp = open(outFileName)
- except IOError, err:
+ except IOError as err:
sys.stderr.write("I/O error: %s\n" % str(err))
sys.exit(2)
format = fp.read().split("\n")
@@ -130,7 +130,7 @@ def main():
format[start:end] = lines
try:
fp = open(outFileName, 'w')
- except IOError, err:
+ except IOError as err:
sys.stderr.write("I/O error: %s\n" % str(err))
sys.exit(4)
fp.write("\n".join(format))