You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
bang on CALL_FUNCTION_EX_KW
This commit is contained in:
Binary file not shown.
BIN
test/bytecode_3.6_run/04_call_function.pyc
Normal file
BIN
test/bytecode_3.6_run/04_call_function.pyc
Normal file
Binary file not shown.
@@ -489,7 +489,7 @@ def customize_for_version(self, is_pypy, version):
|
|||||||
self.n_call_ex_kw3 = call_ex_kw3
|
self.n_call_ex_kw3 = call_ex_kw3
|
||||||
|
|
||||||
def call_ex_kw4(node):
|
def call_ex_kw4(node):
|
||||||
"""Handle CALL_FUNCTION_EX 2 (have KW) but without
|
"""Handle CALL_FUNCTION_EX {1 or 2} (have KW) but without
|
||||||
BUILD_{MAP,TUPLE}_UNPACK_WITH_CALL"""
|
BUILD_{MAP,TUPLE}_UNPACK_WITH_CALL"""
|
||||||
self.preorder(node[0])
|
self.preorder(node[0])
|
||||||
self.write('(')
|
self.write('(')
|
||||||
@@ -508,8 +508,13 @@ def customize_for_version(self, is_pypy, version):
|
|||||||
kwargs = node[2]
|
kwargs = node[2]
|
||||||
if kwargs == 'expr':
|
if kwargs == 'expr':
|
||||||
kwargs = kwargs[0]
|
kwargs = kwargs[0]
|
||||||
self.write('**')
|
call_function_ex = node[-1]
|
||||||
self.preorder(kwargs)
|
assert call_function_ex == 'CALL_FUNCTION_EX_KW'
|
||||||
|
if call_function_ex.attr & 1 and not isinstance(kwargs, Token):
|
||||||
|
self.call36_dict(kwargs)
|
||||||
|
else:
|
||||||
|
self.write('**')
|
||||||
|
self.preorder(kwargs)
|
||||||
self.write(')')
|
self.write(')')
|
||||||
self.prune()
|
self.prune()
|
||||||
self.n_call_ex_kw4 = call_ex_kw4
|
self.n_call_ex_kw4 = call_ex_kw4
|
||||||
|
Reference in New Issue
Block a user