You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Fix a bug in 3.6+ keyword-only argument passing
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -53,3 +53,9 @@ from collections import namedtuple
|
|||||||
Point = namedtuple('Point', 'x y')
|
Point = namedtuple('Point', 'x y')
|
||||||
p = Point(11, 22)
|
p = Point(11, 22)
|
||||||
assert p == Point(**dict(x=11, y=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_inspect.py]=1 # Syntax error Investigate
|
||||||
[test_itertools.py]=1 #
|
[test_itertools.py]=1 #
|
||||||
|
|
||||||
[test_keywordonlyarg.py]=1 # Investigate
|
|
||||||
[test_kqueue.py]=1 # it fails on its own
|
[test_kqueue.py]=1 # it fails on its own
|
||||||
|
|
||||||
[test_lib2to3.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_index.py]=1 # parse error
|
||||||
[test_inspect.py]=1 # test failures
|
[test_inspect.py]=1 # test failures
|
||||||
[test_itertools.py]=1 # parse error
|
[test_itertools.py]=1 # parse error
|
||||||
[test_keywordonlyarg.py]=1 # Investigate: parameter handling
|
|
||||||
[test_kqueue.py]=1 # it fails on its own
|
[test_kqueue.py]=1 # it fails on its own
|
||||||
[test_lib2to3.py]=1 # it fails on its own
|
[test_lib2to3.py]=1 # it fails on its own
|
||||||
[test_long.py]=1 # investigate
|
[test_long.py]=1 # investigate
|
||||||
|
@@ -188,7 +188,7 @@ def customize_for_version36(self, version):
|
|||||||
self.write(', ')
|
self.write(', ')
|
||||||
|
|
||||||
kwargs = node[2]
|
kwargs = node[2]
|
||||||
if kwargs == 'expr':
|
if kwargs == 'expr' and kwargs[0] != "dict":
|
||||||
kwargs = kwargs[0]
|
kwargs = kwargs[0]
|
||||||
if kwargs == 'dict':
|
if kwargs == 'dict':
|
||||||
self.call36_dict(kwargs)
|
self.call36_dict(kwargs)
|
||||||
|
Reference in New Issue
Block a user