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/Demo/parser/test_parser.py b/Demo/parser/test_parser.py
index be39bca..1589f3b 100755
--- a/Demo/parser/test_parser.py
+++ b/Demo/parser/test_parser.py
@@ -17,7 +17,7 @@
# against a large source file like Tkinter.py.
ast = None
new = parser.tuple2ast(tup)
- except parser.ParserError, err:
+ except parser.ParserError as err:
print
print 'parser module raised exception on input file', fileName + ':'
traceback.print_exc()
diff --git a/Demo/parser/unparse.py b/Demo/parser/unparse.py
index 32acbed..1c6e933 100644
--- a/Demo/parser/unparse.py
+++ b/Demo/parser/unparse.py
@@ -492,7 +492,7 @@
print 'Testing %s' % fullname
try:
roundtrip(fullname, output)
- except Exception, e:
+ except Exception as e:
print ' Failed to compile, exception is %s' % repr(e)
elif os.path.isdir(fullname):
testdir(fullname)