diff --git a/test/bytecode_3.6_run/04_lambda_star_default.pyc b/test/bytecode_3.6_run/04_lambda_star_default.pyc new file mode 100644 index 00000000..8ac86b76 Binary files /dev/null and b/test/bytecode_3.6_run/04_lambda_star_default.pyc differ diff --git a/test/bytecode_3.7_run/04_lambda_star_default.pyc b/test/bytecode_3.7_run/04_lambda_star_default.pyc new file mode 100644 index 00000000..14f22521 Binary files /dev/null and b/test/bytecode_3.7_run/04_lambda_star_default.pyc differ diff --git a/uncompyle6/parser.py b/uncompyle6/parser.py index 9185a8c3..f30d6cf4 100644 --- a/uncompyle6/parser.py +++ b/uncompyle6/parser.py @@ -101,7 +101,6 @@ class PythonParser(GenericASTBuilder): many arguments it has. Often it is not used. """ if rule not in self.new_rules: - # print("XXX ", rule) # debug self.new_rules.add(rule) self.addRule(rule, nop_func) customize[opname] = arg_count diff --git a/uncompyle6/semantics/make_function.py b/uncompyle6/semantics/make_function.py index 62d7c30e..7a9a75bf 100644 --- a/uncompyle6/semantics/make_function.py +++ b/uncompyle6/semantics/make_function.py @@ -798,7 +798,7 @@ def make_function3(self, node, is_lambda, nested=1, code_node=None): params.reverse() else: params.append("*%s" % code.co_varnames[argc]) - if not is_lambda: + if not is_lambda or self.version >= 3.6: argc += 1 # dump parameter list (with default values) diff --git a/uncompyle6/semantics/pysource.py b/uncompyle6/semantics/pysource.py index 6b146a91..e7307597 100644 --- a/uncompyle6/semantics/pysource.py +++ b/uncompyle6/semantics/pysource.py @@ -484,7 +484,7 @@ class SourceWalker(GenericASTTraversal, object): else: # We can't comment out like above because there may be a trailing ')' # that needs to be written - assert len(node) == 3 and node[2] == "LAMBDA_MARKER" + assert len(node) == 3 and node[2] in ("RETURN_VALUE_LAMBDA", "LAMBDA_MARKER") self.preorder(node[0]) self.prune() @@ -2366,6 +2366,7 @@ class SourceWalker(GenericASTTraversal, object): p_insts = self.p.insts self.p.insts = self.scanner.insts ast = python_parser.parse(self.p, tokens, customize) + self.customize(customize) self.p.insts = p_insts except (python_parser.ParserError, AssertionError) as e: raise ParserError(e, tokens)