diff --git a/pytest/test_grammar.py b/pytest/test_grammar.py index e492218f..e43a1fb3 100644 --- a/pytest/test_grammar.py +++ b/pytest/test_grammar.py @@ -41,14 +41,12 @@ def test_grammar(): expect_lhs.add("annotate_arg") expect_lhs.add("annotate_tuple") unused_rhs.add("mkfunc_annotate") - unused_rhs.add('call') + if PYTHON_VERSION < 3.7: + unused_rhs.add('call') unused_rhs.add("dict_comp") unused_rhs.add("classdefdeco1") - if PYTHON_VERSION < 3.6: - # 3.6 has at least one non-custom call rule - # the others don't - unused_rhs.add('call') - if PYTHON_VERSION == 3.5: + if PYTHON_VERSION != 3.6: + if PYTHON_VERSION in (3.5, 3.7): expect_right_recursive.add((('l_stmts', ('lastl_stmt', 'come_froms', 'l_stmts')))) pass @@ -61,7 +59,7 @@ def test_grammar(): pass else: expect_lhs.add('kwarg') - unused_rhs.add('call') + # unused_rhs.add('call') assert expect_lhs == set(lhs) assert unused_rhs == set(rhs) diff --git a/test/bytecode_3.7/01_while_if_then.pyc b/test/bytecode_3.7/01_while_if_then.pyc new file mode 100644 index 00000000..4e69d6b3 Binary files /dev/null and b/test/bytecode_3.7/01_while_if_then.pyc differ diff --git a/test/bytecode_3.7/02_build_map_unpack_with_call.pyc b/test/bytecode_3.7/02_build_map_unpack_with_call.pyc new file mode 100644 index 00000000..444e1dab Binary files /dev/null and b/test/bytecode_3.7/02_build_map_unpack_with_call.pyc differ diff --git a/test/bytecode_3.7/02_genexpr.pyc b/test/bytecode_3.7/02_genexpr.pyc new file mode 100644 index 00000000..c6100aaf Binary files /dev/null and b/test/bytecode_3.7/02_genexpr.pyc differ diff --git a/uncompyle6/parsers/parse3.py b/uncompyle6/parsers/parse3.py index 2e54cc16..99e91257 100644 --- a/uncompyle6/parsers/parse3.py +++ b/uncompyle6/parsers/parse3.py @@ -595,6 +595,11 @@ class Python3Parser(PythonParser): return_lambda LAMBDA_MARKER """, nop_func) + if self.version <= 3.6: + call_function1 = 'CALL_FUNCTION_1' + else: + call_function1 = 'CALL_METHOD_1' + has_get_iter_call_function1 = False n = len(tokens) max_branches = 0 diff --git a/uncompyle6/parsers/parse37.py b/uncompyle6/parsers/parse37.py index 95164c49..bd6a4d12 100644 --- a/uncompyle6/parsers/parse37.py +++ b/uncompyle6/parsers/parse37.py @@ -37,6 +37,7 @@ class Python37Parser(Python36Parser): attributes ::= IMPORT_FROM ROT_TWO POP_TOP IMPORT_FROM # FIXME: generalize and specialize + attribute37 ::= LOAD_FAST LOAD_METHOD attribute37 ::= LOAD_NAME LOAD_METHOD expr ::= attribute37 diff --git a/uncompyle6/version.py b/uncompyle6/version.py index de5bd9c4..d57ebff6 100644 --- a/uncompyle6/version.py +++ b/uncompyle6/version.py @@ -12,4 +12,4 @@ # along with this program. If not, see . # This file is suitable for sourcing inside bash as # well as importing into Python -VERSION='3.1.2' +VERSION='3.1.3'