diff --git a/test/bytecode_3.6_run/02_call_ex_kw.pyc b/test/bytecode_3.6_run/02_call_ex_kw.pyc index 5f8d4607..36606412 100644 Binary files a/test/bytecode_3.6_run/02_call_ex_kw.pyc and b/test/bytecode_3.6_run/02_call_ex_kw.pyc differ diff --git a/test/bytecode_3.7_run/02_call_ex_kw.pyc b/test/bytecode_3.7_run/02_call_ex_kw.pyc index c9ad7a7b..f04f5096 100644 Binary files a/test/bytecode_3.7_run/02_call_ex_kw.pyc and b/test/bytecode_3.7_run/02_call_ex_kw.pyc differ diff --git a/test/simple_source/bug36/02_call_ex_kw.py b/test/simple_source/bug36/02_call_ex_kw.py index 000c40f9..0ca044b3 100644 --- a/test/simple_source/bug36/02_call_ex_kw.py +++ b/test/simple_source/bug36/02_call_ex_kw.py @@ -53,3 +53,9 @@ from collections import namedtuple Point = namedtuple('Point', 'x y') p = Point(11, 22) assert p == Point(**dict(x=11, y=22)) + +# From 3.7 test/test_keywordonlyarg.py +# Bug was in handling {"4":4} as a dictionary needing ** +def posonly_sum(pos_arg1, *arg, **kwarg): + return pos_arg1 + sum(arg) + sum(kwarg.values()) +assert 1+2+3+4 == posonly_sum(1,*(2,3),**{"4":4}) diff --git a/test/stdlib/3.6-exclude.sh b/test/stdlib/3.6-exclude.sh index 37dd3951..ad1d82e6 100644 --- a/test/stdlib/3.6-exclude.sh +++ b/test/stdlib/3.6-exclude.sh @@ -88,7 +88,6 @@ SKIP_TESTS=( [test_inspect.py]=1 # Syntax error Investigate [test_itertools.py]=1 # - [test_keywordonlyarg.py]=1 # Investigate [test_kqueue.py]=1 # it fails on its own [test_lib2to3.py]=1 # it fails on its own diff --git a/test/stdlib/3.7-exclude.sh b/test/stdlib/3.7-exclude.sh index ad050082..231a9dca 100644 --- a/test/stdlib/3.7-exclude.sh +++ b/test/stdlib/3.7-exclude.sh @@ -54,7 +54,6 @@ SKIP_TESTS=( [test_index.py]=1 # parse error [test_inspect.py]=1 # test failures [test_itertools.py]=1 # parse error - [test_keywordonlyarg.py]=1 # Investigate: parameter handling [test_kqueue.py]=1 # it fails on its own [test_lib2to3.py]=1 # it fails on its own [test_long.py]=1 # investigate diff --git a/uncompyle6/semantics/customize36.py b/uncompyle6/semantics/customize36.py index 8715da98..84b356d8 100644 --- a/uncompyle6/semantics/customize36.py +++ b/uncompyle6/semantics/customize36.py @@ -188,7 +188,7 @@ def customize_for_version36(self, version): self.write(', ') kwargs = node[2] - if kwargs == 'expr': + if kwargs == 'expr' and kwargs[0] != "dict": kwargs = kwargs[0] if kwargs == 'dict': self.call36_dict(kwargs)