diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-08-03 09:14:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-03 09:14:35 (GMT) |
commit | 946a0b69e217ff22a6c056047eab42053e9a2d5f (patch) | |
tree | a06c9d04b4c2f82e4225d94253e54b827c2e9c0e /Lib/test | |
parent | f08b2be4416163e3d18b8d09891e7cda0d8a21d4 (diff) | |
download | cpython-946a0b69e217ff22a6c056047eab42053e9a2d5f.zip cpython-946a0b69e217ff22a6c056047eab42053e9a2d5f.tar.gz cpython-946a0b69e217ff22a6c056047eab42053e9a2d5f.tar.bz2 |
[3.6] bpo-31071: Avoid masking original TypeError in call with * unpacking (GH-2957) (#2991)
when other arguments are passed.
(cherry picked from commit 25e4f77)
Diffstat (limited to 'Lib/test')
-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 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 |