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
This commit is contained in:
Guido van Rossum 2007-01-10 16:19:56 +00:00
parent 893523e80a
commit b940e113bf
295 changed files with 817 additions and 743 deletions

View file

@ -119,7 +119,7 @@ def strftest(now):
for e in expectations:
try:
result = time.strftime(e[0], now)
except ValueError, error:
except ValueError as error:
print "Standard '%s' format gave error:" % e[0], error
continue
if re.match(escapestr(e[1], ampm), result): continue
@ -132,7 +132,7 @@ def strftest(now):
for e in nonstandard_expectations:
try:
result = time.strftime(e[0], now)
except ValueError, result:
except ValueError as result:
if verbose:
print "Error for nonstandard '%s' format (%s): %s" % \
(e[0], e[2], str(result))