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
diff --git a/Lib/plat-mac/pimp.py b/Lib/plat-mac/pimp.py
index ff696b1..6927ad7 100644
--- a/Lib/plat-mac/pimp.py
+++ b/Lib/plat-mac/pimp.py
@@ -76,7 +76,7 @@
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 @@
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")