Fix Bug in 3.6+ in call_ex_kw4 and call_kw36

This commit is contained in:
rocky
2019-12-22 08:49:12 -05:00
parent 8f4343ef22
commit f3bec73840
5 changed files with 9 additions and 0 deletions

View File

@@ -45,3 +45,11 @@ d = (2, 3)
assert f(2, **a) == {'c': 2, 'param1': 2, 'test': 'A'}
assert f3(2, *c, **a) == {'c': 2, 'param1': 2, 'test': 2}
assert f3(*d, **a) == {'c': 2, 'param1': 2, 'test': 3}
# From 3.7 test/test_collections.py
# Bug was in getting **dict(..) right
from collections import namedtuple
Point = namedtuple('Point', 'x y')
p = Point(11, 22)
assert p == Point(**dict(x=11, y=22))

View File

@@ -219,6 +219,7 @@ def customize_for_version36(self, version):
# FIXME: decide if the below test be on kwargs == 'dict'
if (call_function_ex.attr & 1 and
(not isinstance(kwargs, Token) and kwargs != 'attribute')
and kwargs != "call_kw36"
and not kwargs[0].kind.startswith('kvlist')):
self.call36_dict(kwargs)
else: