mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
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:
parent
893523e80a
commit
b940e113bf
295 changed files with 817 additions and 743 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue