Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4604302f
Commit
4604302f
authored
Jul 10, 2010
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#3071: tell how many values were expected when unpacking too many.
parent
04f32397
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
Lib/test/test_unpack.py
Lib/test/test_unpack.py
+3
-3
Python/ceval.c
Python/ceval.c
+2
-1
No files found.
Lib/test/test_unpack.py
View file @
4604302f
...
...
@@ -62,14 +62,14 @@ Unpacking tuple of wrong size
>>> a, b = t
Traceback (most recent call last):
...
ValueError: too many values to unpack
ValueError: too many values to unpack
(expected 2)
Unpacking tuple of wrong size
>>> a, b = l
Traceback (most recent call last):
...
ValueError: too many values to unpack
ValueError: too many values to unpack
(expected 2)
Unpacking sequence too short
...
...
@@ -83,7 +83,7 @@ Unpacking sequence too long
>>> a, b = Seq()
Traceback (most recent call last):
...
ValueError: too many values to unpack
ValueError: too many values to unpack
(expected 2)
Unpacking a sequence where the test for too long raises a different kind of
error
...
...
Python/ceval.c
View file @
4604302f
...
...
@@ -3464,7 +3464,8 @@ unpack_iterable(PyObject *v, int argcnt, int argcntafter, PyObject **sp)
return
1
;
}
Py_DECREF
(
w
);
PyErr_SetString
(
PyExc_ValueError
,
"too many values to unpack"
);
PyErr_Format
(
PyExc_ValueError
,
"too many values to unpack "
"(expected %d)"
,
argcnt
);
goto
Error
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment