You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Remove 3-arg raise in 3.x and..
add tests in 2.x
This commit is contained in:
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.7/02_except_as.pyc
Normal file
BIN
test/bytecode_2.7/02_except_as.pyc
Normal file
Binary file not shown.
@@ -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')
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user