diff --git a/test/bytecode_3.3/02_pos_args.pyc-notyet b/test/bytecode_3.3/02_pos_args.pyc-notyet deleted file mode 100644 index a3aaed74..00000000 Binary files a/test/bytecode_3.3/02_pos_args.pyc-notyet and /dev/null differ diff --git a/test/bytecode_3.3_run/02_pos_args.pyc b/test/bytecode_3.3_run/02_pos_args.pyc new file mode 100644 index 00000000..c79d7b87 Binary files /dev/null and b/test/bytecode_3.3_run/02_pos_args.pyc differ diff --git a/test/bytecode_3.5_run/02_pos_args.pyc b/test/bytecode_3.5_run/02_pos_args.pyc new file mode 100644 index 00000000..78e416c6 Binary files /dev/null and b/test/bytecode_3.5_run/02_pos_args.pyc differ diff --git a/uncompyle6/semantics/customize37.py b/uncompyle6/semantics/customize37.py index a552784c..d6aab1a1 100644 --- a/uncompyle6/semantics/customize37.py +++ b/uncompyle6/semantics/customize37.py @@ -15,7 +15,11 @@ """Isolate Python 3.7 version-specific semantic actions here. """ -from uncompyle6.semantics.consts import PRECEDENCE, TABLE_DIRECT, maxint +from uncompyle6.semantics.consts import ( + PRECEDENCE, + TABLE_DIRECT, + maxint, +) def customize_for_version37(self, version): ######################## @@ -135,9 +139,9 @@ def customize_for_version37(self, version): (3, 'importlist37') ), "importattr37": ("%c", (0, "IMPORT_NAME_ATTR")), - 'importlist37': ("%C", (0, maxint, ', ') ), - 'list_if37': ( " if %p%c", (0, 27), 1 ), - 'list_if37_not': ( " if not %p%c", (0, 27), 1 ), + "importlist37": ("%C", (0, maxint, ", ")), + "list_if37": (" if %p%c", (0, 27), 1), + "list_if37_not": (" if not %p%c", (0, 27), 1), "testfalse_not_or": ("not %c or %c", (0, "expr"), (2, "expr")), "testfalse_not_and": ("not (%c)", 0), "try_except36": ("%|try:\n%+%c%-%c\n\n", 1, -2), @@ -158,5 +162,6 @@ def customize_for_version37(self, version): break self.template_engine(("%C", (0, i + 1, ', ')), node) self.prune() + return self.n_importlist37 = n_importlist37 diff --git a/uncompyle6/semantics/make_function3.py b/uncompyle6/semantics/make_function3.py index 7d606038..3a2dde56 100644 --- a/uncompyle6/semantics/make_function3.py +++ b/uncompyle6/semantics/make_function3.py @@ -1,4 +1,4 @@ -# Copyright (c) 2015-2019 by Rocky Bernstein +# Copyright (c) 2015-2020 by Rocky Bernstein # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -538,6 +538,10 @@ def make_function3(self, node, is_lambda, nested=1, code_node=None): params.reverse() if not is_lambda: argc += 1 + pass + elif is_lambda and kwonlyargcount > 0: + params.insert(0, "*") + kwonlyargcount = 0 # dump parameter list (with default values) if is_lambda: