You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Fix 3.7 aysnc def testing
This commit is contained in:
1
Makefile
1
Makefile
@@ -38,6 +38,7 @@ check-3.0 check-3.1 check-3.2 check-3.6:
|
|||||||
$(MAKE) -C test $@
|
$(MAKE) -C test $@
|
||||||
|
|
||||||
check-3.7: pytest
|
check-3.7: pytest
|
||||||
|
$(MAKE) -C test check
|
||||||
|
|
||||||
#:PyPy 2.6.1 PyPy 5.0.1, or PyPy 5.8.0-beta0
|
#:PyPy 2.6.1 PyPy 5.0.1, or PyPy 5.8.0-beta0
|
||||||
# Skip for now
|
# Skip for now
|
||||||
|
Binary file not shown.
BIN
test/bytecode_3.7/04_importlist.pyc
Normal file
BIN
test/bytecode_3.7/04_importlist.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_3.7/04_raise.pyc
Normal file
BIN
test/bytecode_3.7/04_raise.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_3.7/04_try_finally.pyc
Normal file
BIN
test/bytecode_3.7/04_try_finally.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_3.7_run/01_fstring.pyc
Normal file
BIN
test/bytecode_3.7_run/01_fstring.pyc
Normal file
Binary file not shown.
@@ -295,12 +295,17 @@ class Python36Parser(Python35Parser):
|
|||||||
""", nop_func)
|
""", nop_func)
|
||||||
if self.version > 3.6:
|
if self.version > 3.6:
|
||||||
self.addRule("""
|
self.addRule("""
|
||||||
expr ::= call_ex_kw3
|
|
||||||
expr ::= call_ex_kw
|
expr ::= call_ex_kw
|
||||||
|
expr ::= call_ex_kw3
|
||||||
|
expr ::= call_ex_kw4
|
||||||
call_ex_kw3 ::= expr
|
call_ex_kw3 ::= expr
|
||||||
build_tuple_unpack_with_call
|
build_tuple_unpack_with_call
|
||||||
expr
|
expr
|
||||||
CALL_FUNCTION_EX
|
CALL_FUNCTION_EX
|
||||||
|
call_ex_kw4 ::= expr
|
||||||
|
expr
|
||||||
|
expr
|
||||||
|
CALL_FUNCTION_EX
|
||||||
call_ex_kw ::= expr expr
|
call_ex_kw ::= expr expr
|
||||||
build_map_unpack_with_call CALL_FUNCTION_EX
|
build_map_unpack_with_call CALL_FUNCTION_EX
|
||||||
""", nop_func)
|
""", nop_func)
|
||||||
|
@@ -350,7 +350,7 @@ def customize_for_version3(self, version):
|
|||||||
self.n_call = n_call
|
self.n_call = n_call
|
||||||
|
|
||||||
def n_function_def(node):
|
def n_function_def(node):
|
||||||
if self.version == 3.6:
|
if self.version >= 3.6:
|
||||||
code_node = node[0][0]
|
code_node = node[0][0]
|
||||||
else:
|
else:
|
||||||
code_node = node[0][1]
|
code_node = node[0][1]
|
||||||
@@ -634,7 +634,8 @@ def customize_for_version3(self, version):
|
|||||||
if kwargs == 'expr':
|
if kwargs == 'expr':
|
||||||
kwargs = kwargs[0]
|
kwargs = kwargs[0]
|
||||||
call_function_ex = node[-1]
|
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'
|
# FIXME: decide if the below test be on kwargs == 'dict'
|
||||||
if (call_function_ex.attr & 1 and
|
if (call_function_ex.attr & 1 and
|
||||||
(not isinstance(kwargs, Token) and kwargs != 'attribute')
|
(not isinstance(kwargs, Token) and kwargs != 'attribute')
|
||||||
|
Reference in New Issue
Block a user