bang on CALL_FUNCTION_EX_KW

This commit is contained in:
rocky
2018-03-24 10:52:55 -04:00
parent 1f663013ab
commit 2ae9cd7d08
3 changed files with 8 additions and 3 deletions

Binary file not shown.

View File

@@ -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