Remove 3-arg raise in 3.x and..

add tests in 2.x
This commit is contained in:
rocky
2017-12-02 22:07:44 -05:00
parent e172a8f3c0
commit de594ce7f2
5 changed files with 7 additions and 2 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,4 +1,6 @@
# From 2.6.9 ConfigParser.py # From 2.6.9 ConfigParser.py
# Note this can only be compiled in Python 2.x
#
# Bug was being able to handle: # Bug was being able to handle:
# except KeyError, e # except KeyError, e
# vs 2.6+. # vs 2.6+.
@@ -12,7 +14,12 @@
# #
# Python 2.6 allows both, but we use the older form since # Python 2.6 allows both, but we use the older form since
# that matches the grammar for how this gets parsed # that matches the grammar for how this gets parsed
try: try:
value = "foo" value = "foo"
except RuntimeError:
# Test:
# raise_stmt3 ::= expr expr expr RAISE_VARARGS_3
raise 1, 2, 3
except KeyError, e: except KeyError, e:
raise RuntimeError('foo') raise RuntimeError('foo')

View File

@@ -99,12 +99,10 @@ class Python3Parser(PythonParser):
stmt ::= raise_stmt0 stmt ::= raise_stmt0
stmt ::= raise_stmt1 stmt ::= raise_stmt1
stmt ::= raise_stmt2 stmt ::= raise_stmt2
stmt ::= raise_stmt3
raise_stmt0 ::= RAISE_VARARGS_0 raise_stmt0 ::= RAISE_VARARGS_0
raise_stmt1 ::= expr RAISE_VARARGS_1 raise_stmt1 ::= expr RAISE_VARARGS_1
raise_stmt2 ::= expr expr RAISE_VARARGS_2 raise_stmt2 ::= expr expr RAISE_VARARGS_2
raise_stmt3 ::= expr expr expr RAISE_VARARGS_3
del_stmt ::= delete_subscr del_stmt ::= delete_subscr
delete_subscr ::= expr expr DELETE_SUBSCR delete_subscr ::= expr expr DELETE_SUBSCR