mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2024-11-23 05:00:07 +00:00
Fix a bug in 3.6+ keyword-only argument passing
This commit is contained in:
parent
e466e826b3
commit
beac1d3567
Binary file not shown.
Binary file not shown.
@ -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})
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user