diff --git a/test/bytecode_3.5_run/04_call_function.pyc b/test/bytecode_3.5_run/04_call_function.pyc index 21f59e97..99d98c11 100644 Binary files a/test/bytecode_3.5_run/04_call_function.pyc and b/test/bytecode_3.5_run/04_call_function.pyc differ diff --git a/test/bytecode_3.6_run/04_call_function.pyc b/test/bytecode_3.6_run/04_call_function.pyc index da2cb65f..d3d7fb9f 100644 Binary files a/test/bytecode_3.6_run/04_call_function.pyc and b/test/bytecode_3.6_run/04_call_function.pyc differ diff --git a/test/simple_source/bug35/04_call_function.py b/test/simple_source/bug35/04_call_function.py index 9242022e..b3a7adca 100644 --- a/test/simple_source/bug35/04_call_function.py +++ b/test/simple_source/bug35/04_call_function.py @@ -47,3 +47,7 @@ def __init__(self, cnf={}): def Value(self, fn, typecode_or_type, *args, lock=True): return fn(typecode_or_type, *args, lock=lock, ctx=self.get_context()) + +# From 3.6.4 heapq.py +def merge(*iterables, key=None, reverse=False): + return diff --git a/uncompyle6/parsers/parse35.py b/uncompyle6/parsers/parse35.py index 5358d464..382fb489 100644 --- a/uncompyle6/parsers/parse35.py +++ b/uncompyle6/parsers/parse35.py @@ -33,7 +33,7 @@ class Python35Parser(Python34Parser): # ... # the end of the if will jump back to the loop and there will be a COME_FROM # after the jump - l_stmts ::= lastl_stmt COME_FROM l_stmts + l_stmts ::= lastl_stmt come_froms l_stmts # Python 3.5+ Await statement expr ::= await_expr diff --git a/uncompyle6/parsers/parse36.py b/uncompyle6/parsers/parse36.py index 17d0ef56..dde2b0aa 100644 --- a/uncompyle6/parsers/parse36.py +++ b/uncompyle6/parsers/parse36.py @@ -49,8 +49,9 @@ class Python36Parser(Python35Parser): whilestmt ::= SETUP_LOOP testexpr l_stmts_opt JUMP_BACK come_froms POP_BLOCK COME_FROM_LOOP - # This might be valid in < 3.6 + # A COME_FROM is dropped off because of JUMP-to-JUMP optimization and ::= expr jmp_false expr + and ::= expr jmp_false expr jmp_false jf_cf ::= JUMP_FORWARD COME_FROM conditional ::= expr jmp_false expr jf_cf expr COME_FROM diff --git a/uncompyle6/semantics/make_function.py b/uncompyle6/semantics/make_function.py index 88502706..6b744c99 100644 --- a/uncompyle6/semantics/make_function.py +++ b/uncompyle6/semantics/make_function.py @@ -592,7 +592,10 @@ def make_function3(self, node, is_lambda, nested=1, codeNode=None): params.reverse() # back to correct order if code_has_star_arg(code): - if self.version > 3.0: + if self.version >= 3.6: + j = -2 if code_has_star_star_arg(code) else -1 + params.append('*%s' % code.co_varnames[j]) + elif self.version > 3.0: params.append('*%s' % code.co_varnames[argc + kw_pairs]) else: params.append('*%s' % code.co_varnames[argc])