mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +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
|
@ -76,7 +76,7 @@ def getDefaultDatabase(experimental=False):
|
|||
url = DEFAULT_PIMPDATABASE_FMT % (PIMP_VERSION, status, pyvers, osname, rel, machine)
|
||||
try:
|
||||
urllib2.urlopen(url)
|
||||
except urllib2.HTTPError, arg:
|
||||
except urllib2.HTTPError as arg:
|
||||
pass
|
||||
else:
|
||||
break
|
||||
|
@ -589,13 +589,13 @@ class PimpPackage:
|
|||
installTest = self._dict['Install-test'].strip() + '\n'
|
||||
try:
|
||||
exec(installTest, namespace)
|
||||
except ImportError, arg:
|
||||
except ImportError as arg:
|
||||
return "no", str(arg)
|
||||
except _scriptExc_NotInstalled, arg:
|
||||
except _scriptExc_NotInstalled as arg:
|
||||
return "no", str(arg)
|
||||
except _scriptExc_OldInstalled, arg:
|
||||
except _scriptExc_OldInstalled as arg:
|
||||
return "old", str(arg)
|
||||
except _scriptExc_BadInstalled, arg:
|
||||
except _scriptExc_BadInstalled as arg:
|
||||
return "bad", str(arg)
|
||||
except:
|
||||
sys.stderr.write("-------------------------------------\n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue