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/cgi.py b/Lib/cgi.py
index 80b3b7a..0cc5fad 100755
--- a/Lib/cgi.py
+++ b/Lib/cgi.py
@@ -982,7 +982,7 @@
     print "<H3>Current Working Directory:</H3>"
     try:
         pwd = os.getcwd()
-    except os.error, msg:
+    except os.error as msg:
         print "os.error:", escape(str(msg))
     else:
         print escape(pwd)