From de594ce7f213cfc7ecda252942e1408c07446f91 Mon Sep 17 00:00:00 2001 From: rocky Date: Sat, 2 Dec 2017 22:07:44 -0500 Subject: [PATCH] Remove 3-arg raise in 3.x and.. add tests in 2.x --- test/bytecode_2.5/02_except_as.pyc | Bin 228 -> 277 bytes test/bytecode_2.6/02_except_as.pyc | Bin 228 -> 277 bytes test/bytecode_2.7/02_except_as.pyc | Bin 0 -> 273 bytes test/simple_source/bug26/02_except_as.py | 7 +++++++ uncompyle6/parsers/parse3.py | 2 -- 5 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 test/bytecode_2.7/02_except_as.pyc diff --git a/test/bytecode_2.5/02_except_as.pyc b/test/bytecode_2.5/02_except_as.pyc index d832b2b281af0f478876efc2c38b0a6d98d4a43d..c2a383f80f2c903ae03204600e7126f8636884bb 100644 GIT binary patch delta 219 zcmXX;!3n}Z5S+b>Acsm&Y(PKhB0lsbi0DJfPrMUO^a9C6$V-S7HQ&8tI;5#3Achq@*=Dtfg2ru5F1u4 z$QZ@Mz?jMml5A#VXkui@1M(wM7#V^!n1I?!n1MuEe!iau3y23YvMe#DG_`~S$ns9D tbS)~%FDhXKa)eS#cz{$;XAUFU3 diff --git a/test/bytecode_2.6/02_except_as.pyc b/test/bytecode_2.6/02_except_as.pyc index b94bb8fb089c626f1beb83eb9b194d5569b94d26..93f36b3b14063633cd602a9dbbdd06e09b4ac46e 100644 GIT binary patch delta 219 zcmXX;!3n}Z5S+b>Acsm&Y(PKhB0lsbi0DJfPrMUO^a9C6$V-S7HQ&8tI;5#3Achq@*=Dtfg2ru5F1u4 z$QZ@Mz?jMml5A#VXkui@1M(wM7#V^!n1I?!n1MuEe!iau3y23YvMe#DG_`~S$ns9D tbS)~%FDhXKa)eS#cz{$;Xze>bF5XQgBMv%qhz!$K%CN`d2VWWtRSSS`=p`;0Cc9g{=8}^Tw_IxxS$ro_; z6dah}{Q2e^^*z&Hc2T$Zi#@4VlHpD;X&9ge9*1+3OnB4q#~>m@Fa?alR$(|2t=MTd zpjv_CQhc9;Eny%$nG)+Ne~wD<;+!R^w#dkv`>GVieDS{N62}AS9?}qP&)42NANOT( z%hT_W&0GoakFbz2*naG|2`>4Tm(S^Sb+$ZRHT==?7@JKv8K>Q+i{6>k@#SImXn`V4 JGc~6<{QxMXG6ett literal 0 HcmV?d00001 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