diff --git a/test/bytecode_2.5/02_except_as.pyc b/test/bytecode_2.5/02_except_as.pyc index d832b2b2..c2a383f8 100644 Binary files a/test/bytecode_2.5/02_except_as.pyc and b/test/bytecode_2.5/02_except_as.pyc differ diff --git a/test/bytecode_2.6/02_except_as.pyc b/test/bytecode_2.6/02_except_as.pyc index b94bb8fb..93f36b3b 100644 Binary files a/test/bytecode_2.6/02_except_as.pyc and b/test/bytecode_2.6/02_except_as.pyc differ diff --git a/test/bytecode_2.7/02_except_as.pyc b/test/bytecode_2.7/02_except_as.pyc new file mode 100644 index 00000000..b01783f3 Binary files /dev/null and b/test/bytecode_2.7/02_except_as.pyc differ diff --git a/test/simple_source/bug26/02_except_as.py b/test/simple_source/bug26/02_except_as.py index cc8efa74..1b2e7539 100644 --- a/test/simple_source/bug26/02_except_as.py +++ b/test/simple_source/bug26/02_except_as.py @@ -1,4 +1,6 @@ # From 2.6.9 ConfigParser.py +# Note this can only be compiled in Python 2.x +# # Bug was being able to handle: # except KeyError, e # vs 2.6+. @@ -12,7 +14,12 @@ # # Python 2.6 allows both, but we use the older form since # that matches the grammar for how this gets parsed + try: value = "foo" +except RuntimeError: + # Test: + # raise_stmt3 ::= expr expr expr RAISE_VARARGS_3 + raise 1, 2, 3 except KeyError, e: raise RuntimeError('foo') diff --git a/uncompyle6/parsers/parse3.py b/uncompyle6/parsers/parse3.py index ca53064c..08322401 100644 --- a/uncompyle6/parsers/parse3.py +++ b/uncompyle6/parsers/parse3.py @@ -99,12 +99,10 @@ class Python3Parser(PythonParser): stmt ::= raise_stmt0 stmt ::= raise_stmt1 stmt ::= raise_stmt2 - stmt ::= raise_stmt3 raise_stmt0 ::= RAISE_VARARGS_0 raise_stmt1 ::= expr RAISE_VARARGS_1 raise_stmt2 ::= expr expr RAISE_VARARGS_2 - raise_stmt3 ::= expr expr expr RAISE_VARARGS_3 del_stmt ::= delete_subscr delete_subscr ::= expr expr DELETE_SUBSCR