diff --git a/Makefile b/Makefile index 33b13449..5fe5d565 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,7 @@ check-3.0 check-3.1 check-3.2 check-3.6: $(MAKE) -C test $@ check-3.7: pytest + $(MAKE) -C test check #:PyPy 2.6.1 PyPy 5.0.1, or PyPy 5.8.0-beta0 # Skip for now diff --git a/test/bytecode_3.7/04_class_kwargs.pyc b/test/bytecode_3.7/04_class_kwargs.pyc index a8317b70..1c095ac6 100644 Binary files a/test/bytecode_3.7/04_class_kwargs.pyc and b/test/bytecode_3.7/04_class_kwargs.pyc differ diff --git a/test/bytecode_3.7/04_importlist.pyc b/test/bytecode_3.7/04_importlist.pyc new file mode 100644 index 00000000..61543575 Binary files /dev/null and b/test/bytecode_3.7/04_importlist.pyc differ diff --git a/test/bytecode_3.7/04_raise.pyc b/test/bytecode_3.7/04_raise.pyc new file mode 100644 index 00000000..044bb091 Binary files /dev/null and b/test/bytecode_3.7/04_raise.pyc differ diff --git a/test/bytecode_3.7/04_try_finally.pyc b/test/bytecode_3.7/04_try_finally.pyc new file mode 100644 index 00000000..50dff937 Binary files /dev/null and b/test/bytecode_3.7/04_try_finally.pyc differ diff --git a/test/bytecode_3.7_run/01_fstring.pyc b/test/bytecode_3.7_run/01_fstring.pyc new file mode 100644 index 00000000..b4da5675 Binary files /dev/null and b/test/bytecode_3.7_run/01_fstring.pyc differ diff --git a/uncompyle6/parsers/parse36.py b/uncompyle6/parsers/parse36.py index 90b107d7..8397809d 100644 --- a/uncompyle6/parsers/parse36.py +++ b/uncompyle6/parsers/parse36.py @@ -295,12 +295,17 @@ class Python36Parser(Python35Parser): """, nop_func) if self.version > 3.6: self.addRule(""" - expr ::= call_ex_kw3 expr ::= call_ex_kw + expr ::= call_ex_kw3 + expr ::= call_ex_kw4 call_ex_kw3 ::= expr build_tuple_unpack_with_call expr CALL_FUNCTION_EX + call_ex_kw4 ::= expr + expr + expr + CALL_FUNCTION_EX call_ex_kw ::= expr expr build_map_unpack_with_call CALL_FUNCTION_EX """, nop_func) diff --git a/uncompyle6/semantics/customize3.py b/uncompyle6/semantics/customize3.py index afd1ab99..6cd41e65 100644 --- a/uncompyle6/semantics/customize3.py +++ b/uncompyle6/semantics/customize3.py @@ -350,7 +350,7 @@ def customize_for_version3(self, version): self.n_call = n_call def n_function_def(node): - if self.version == 3.6: + if self.version >= 3.6: code_node = node[0][0] else: code_node = node[0][1] @@ -634,7 +634,8 @@ def customize_for_version3(self, version): if kwargs == 'expr': kwargs = kwargs[0] call_function_ex = node[-1] - assert call_function_ex == 'CALL_FUNCTION_EX_KW' + assert (call_function_ex == 'CALL_FUNCTION_EX_KW' + or (self.version >= 3.6 and call_function_ex == 'CALL_FUNCTION_EX')) # FIXME: decide if the below test be on kwargs == 'dict' if (call_function_ex.attr & 1 and (not isinstance(kwargs, Token) and kwargs != 'attribute')