diff options
author | R David Murray <rdmurray@bitdance.com> | 2015-04-15 21:08:45 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2015-04-15 21:08:45 (GMT) |
commit | 4171bbe687904582329c7977d571686953275b45 (patch) | |
tree | 35b0ca3d4c7dc8acd81aba0e9a2ee0b4dc51e07b /Lib/test/test_unpack_ex.py | |
parent | 13a6ee0af45e2adc508489fb60a29069905331a7 (diff) | |
download | cpython-4171bbe687904582329c7977d571686953275b45.zip cpython-4171bbe687904582329c7977d571686953275b45.tar.gz cpython-4171bbe687904582329c7977d571686953275b45.tar.bz2 |
#23949: Improve tuple unpacking error messages.
Patch by Arnon Yaari.
Diffstat (limited to 'Lib/test/test_unpack_ex.py')
-rw-r--r-- | Lib/test/test_unpack_ex.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_unpack_ex.py b/Lib/test/test_unpack_ex.py index ae2dcbd..54666b0 100644 --- a/Lib/test/test_unpack_ex.py +++ b/Lib/test/test_unpack_ex.py @@ -85,7 +85,14 @@ Unpacking sequence too short >>> a, *b, c, d, e = Seq() Traceback (most recent call last): ... - ValueError: need more than 3 values to unpack + ValueError: not enough values to unpack (expected at least 4, got 3) + +Unpacking sequence too short and target appears last + + >>> a, b, c, d, *e = Seq() + Traceback (most recent call last): + ... + ValueError: not enough values to unpack (expected at least 4, got 3) Unpacking a sequence where the test for too long raises a different kind of error |