From 63a88b8eea4cb57b34b10204c9b9cfffbf02522e Mon Sep 17 00:00:00 2001 From: rocky Date: Mon, 6 Jan 2020 10:54:14 -0500 Subject: [PATCH] Some Python 3.x lambda params are in reverse order --- test/stdlib/runtests.sh | 11 ++++------- uncompyle6/semantics/make_function3.py | 5 ++--- uncompyle6/semantics/make_function36.py | 6 ++---- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/test/stdlib/runtests.sh b/test/stdlib/runtests.sh index 63756456..7e5395be 100755 --- a/test/stdlib/runtests.sh +++ b/test/stdlib/runtests.sh @@ -232,9 +232,8 @@ case $PYVERSION in 3.5) SKIP_TESTS=( [test_ast.py]=1 # line 379, in test_literal_eval self.assertEqual(ast.literal_eval('b"hi"'), 'hi') - [test_atexit.py]=1 # + [test_atexit.py]=1 [test_builtin.py]=1 # - [test_compare.py]=1 [test_dis.py]=1 # We change line numbers - duh! ) if (( batch )) ; then @@ -247,11 +246,9 @@ case $PYVERSION in 3.6) SKIP_TESTS=( - [test_ast.py]=1 # [test_atexit.py]=1 # [test_bdb.py]=1 # - [test_builtin.py]=1 # - [test_compare.py]=1 + [test_builtin.py]=1 # Fails on its own [test_compile.py]=1 [test_contains.py]=1 # Code "while False: yield None" is optimized away in compilation [test_contextlib_async.py]=1 # Investigate @@ -263,7 +260,7 @@ case $PYVERSION in ;; 3.7) SKIP_TESTS=( - [test_ast.py]=1 # + [test_ast.py]=1 # test assertion error [test_atexit.py]=1 # [test_baseexception.py]=1 # [test_bdb.py]=1 # @@ -271,7 +268,7 @@ case $PYVERSION in [test_builtin.py]=1 # parser error [test_cmdline.py]=1 # Interactive? [test_collections.py]=1 # Fixed I think in decompyle3 - pull from there - [test_compare.py]=1 + [test_compare.py]=1 # test assert fail - investigate [test_compile.py]=1 [test_configparser.py]=1 [test_contains.py]=1 # Code "while False: yield None" is optimized away in compilation diff --git a/uncompyle6/semantics/make_function3.py b/uncompyle6/semantics/make_function3.py index 02b64f69..91eae46c 100644 --- a/uncompyle6/semantics/make_function3.py +++ b/uncompyle6/semantics/make_function3.py @@ -482,9 +482,8 @@ def make_function3(self, node, is_lambda, nested=1, code_node=None): kwargs = list(scanner_code.co_varnames[argc : argc + kwonlyargcount]) # defaults are for last n parameters when not in a lambda, thus reverse - if not is_lambda: - paramnames.reverse() - defparams.reverse() + paramnames.reverse() + defparams.reverse() try: ast = self.build_ast( diff --git a/uncompyle6/semantics/make_function36.py b/uncompyle6/semantics/make_function36.py index 97d3baa4..142d7601 100644 --- a/uncompyle6/semantics/make_function36.py +++ b/uncompyle6/semantics/make_function36.py @@ -201,10 +201,8 @@ def make_function36(self, node, is_lambda, nested=1, code_node=None): paramnames = list(scanner_code.co_varnames[:argc]) kwargs = list(scanner_code.co_varnames[argc : argc + kwonlyargcount]) - # defaults are for last n parameters when not in a lambda, thus reverse - if not is_lambda: - paramnames.reverse() - defparams.reverse() + paramnames.reverse() + defparams.reverse() try: ast = self.build_ast(