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/test/test_codecs.py b/Lib/test/test_codecs.py
index 3c800f8..0711923 100644
--- a/Lib/test/test_codecs.py
+++ b/Lib/test/test_codecs.py
@@ -595,7 +595,7 @@
         if sys.maxunicode > 0xffff:
             try:
                 "\x00\x00\x00\x00\x00\x11\x11\x00".decode("unicode_internal")
-            except UnicodeDecodeError, ex:
+            except UnicodeDecodeError as ex:
                 self.assertEquals("unicode_internal", ex.encoding)
                 self.assertEquals("\x00\x00\x00\x00\x00\x11\x11\x00", ex.object)
                 self.assertEquals(4, ex.start)
@@ -782,7 +782,7 @@
                 prepped = unicode(prepped, "utf-8")
                 try:
                     self.assertEquals(nameprep(orig), prepped)
-                except Exception,e:
+                except Exception as e:
                     raise test_support.TestFailed("Test 3.%d: %s" % (pos+1, str(e)))
 
 class IDNACodecTest(unittest.TestCase):