diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-08-03 11:37:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-03 11:37:15 +0300 |
commit | 25e4f779d7ae9f37a1933cb5cbfad06e673c01f9 (patch) | |
tree | cf3671f5eed00c26f2ccef0634ff4ce556aac286 /Lib/test/test_extcall.py | |
parent | 49b2734bf12dc1cda80fd73d3ec8896ae3e362f2 (diff) | |
download | cpython-git-25e4f779d7ae9f37a1933cb5cbfad06e673c01f9.tar.gz |
bpo-31071: Avoid masking original TypeError in call with * unpacking (#2957)
when other arguments are passed.
Diffstat (limited to 'Lib/test/test_extcall.py')
-rw-r--r-- | Lib/test/test_extcall.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_extcall.py b/Lib/test/test_extcall.py index 043df01311..2c1848337b 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 |