summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-08-03 08:37:15 (GMT)
committerGitHub <noreply@github.com>2017-08-03 08:37:15 (GMT)
commit25e4f779d7ae9f37a1933cb5cbfad06e673c01f9 (patch)
treecf3671f5eed00c26f2ccef0634ff4ce556aac286 /Lib
parent49b2734bf12dc1cda80fd73d3ec8896ae3e362f2 (diff)
downloadcpython-25e4f779d7ae9f37a1933cb5cbfad06e673c01f9.zip
cpython-25e4f779d7ae9f37a1933cb5cbfad06e673c01f9.tar.gz
cpython-25e4f779d7ae9f37a1933cb5cbfad06e673c01f9.tar.bz2
bpo-31071: Avoid masking original TypeError in call with * unpacking (#2957)
when other arguments are passed.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_extcall.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_extcall.py b/Lib/test/test_extcall.py
index 043df01..2c18483 100644
--- a/Lib/test/test_extcall.py
+++ b/Lib/test/test_extcall.py
@@ -163,6 +163,10 @@ right error message? (Also check with other iterables.)
Traceback (most recent call last):
...
TypeError: myerror
+ >>> g(*range(1), *(broken() for i in range(1)))
+ Traceback (most recent call last):
+ ...
+ TypeError: myerror
>>> class BrokenIterable1:
... def __iter__(self):
@@ -172,6 +176,10 @@ right error message? (Also check with other iterables.)
Traceback (most recent call last):
...
TypeError: myerror
+ >>> g(*range(1), *BrokenIterable1())
+ Traceback (most recent call last):
+ ...
+ TypeError: myerror
>>> class BrokenIterable2:
... def __iter__(self):
@@ -182,6 +190,10 @@ right error message? (Also check with other iterables.)
Traceback (most recent call last):
...
TypeError: myerror
+ >>> g(*range(1), *BrokenIterable2())
+ Traceback (most recent call last):
+ ...
+ TypeError: myerror
>>> class BrokenSequence:
... def __getitem__(self, idx):
@@ -191,6 +203,10 @@ right error message? (Also check with other iterables.)
Traceback (most recent call last):
...
TypeError: myerror
+ >>> g(*range(1), *BrokenSequence())
+ Traceback (most recent call last):
+ ...
+ TypeError: myerror
Make sure that the function doesn't stomp the dictionary