summaryrefslogtreecommitdiffstats
path: root/Lib/test/regrtest.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-01-10 16:19:56 (GMT)
committerGuido van Rossum <guido@python.org>2007-01-10 16:19:56 (GMT)
commitb940e113bf90ff71b0ef57414ea2beea9d2a4bc0 (patch)
tree0b9ea19eba1e665dac95126c3140ac2bc36326ad /Lib/test/regrtest.py
parent893523e80a2003d4a630aafb84ba016e0070cbbd (diff)
downloadcpython-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/test/regrtest.py')
-rwxr-xr-xLib/test/regrtest.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index 8c0f2e4..ce39649 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -211,7 +211,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
'coverdir=', 'nocoverdir', 'runleaks',
'huntrleaks=', 'verbose2', 'memlimit=',
])
- except getopt.error, msg:
+ except getopt.error as msg:
usage(2, msg)
# Defaults
@@ -556,19 +556,19 @@ def runtest_inner(test, generate, verbose, quiet,
dash_R(the_module, test, indirect_test, huntrleaks)
finally:
sys.stdout = save_stdout
- except test_support.ResourceDenied, msg:
+ except test_support.ResourceDenied as msg:
if not quiet:
print test, "skipped --", msg
sys.stdout.flush()
return -2
- except (ImportError, test_support.TestSkipped), msg:
+ except (ImportError, test_support.TestSkipped) as msg:
if not quiet:
print test, "skipped --", msg
sys.stdout.flush()
return -1
except KeyboardInterrupt:
raise
- except test_support.TestFailed, msg:
+ except test_support.TestFailed as msg:
print "test", test, "failed --", msg
sys.stdout.flush()
return 0
@@ -640,7 +640,7 @@ def cleanup_test_droppings(testname, verbose):
print "%r left behind %s %r" % (testname, kind, name)
try:
nuker(name)
- except Exception, msg:
+ except Exception as msg:
print >> sys.stderr, ("%r left behind %s %r and it couldn't be "
"removed: %s" % (testname, kind, name, msg))