From eed4c1025b442f4f897f600feed920e09a109038 Mon Sep 17 00:00:00 2001 From: rocky Date: Wed, 30 Oct 2019 11:41:22 -0400 Subject: [PATCH] Pypy 3.6 tolerance --- test/Makefile | 2 +- uncompyle6/parsers/parse3.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/Makefile b/test/Makefile index 8891ccbb..6f72d503 100644 --- a/test/Makefile +++ b/test/Makefile @@ -100,7 +100,7 @@ check-bytecode-3: --bytecode-3.1 --bytecode-3.2 --bytecode-3.3 \ --bytecode-3.4 --bytecode-3.5 --bytecode-3.6 \ --bytecode-3.7 \ - --bytecode-pypy3.2 # --bytecode-3.8 --bytecode-pypy3.6 -- work out bugs in 3.6 and 3.8 + --bytecode-pypy3.2 --bytecode-pypy3.6 # --bytecode-3.8 -- work out bugs in 3.8 #: Check deparsing on selected bytecode 3.x check-bytecode-3-short: diff --git a/uncompyle6/parsers/parse3.py b/uncompyle6/parsers/parse3.py index 2578e31e..3b9beb2b 100644 --- a/uncompyle6/parsers/parse3.py +++ b/uncompyle6/parsers/parse3.py @@ -1160,6 +1160,14 @@ class Python3Parser(PythonParser): opname, ) self.add_unique_rule(rule, opname, token.attr, customize) + if not PYTHON3 and self.is_pypy: + rule = "mkfunc ::= %s%s%s%s" % ( + "expr " * stack_count, + "load_closure " * closure, + "LOAD_CODE LOAD_CONST ", + opname, + ) + self.add_unique_rule(rule, opname, token.attr, customize) if has_get_iter_call_function1: rule_pat = (