#3071: tell how many values were expected when unpacking too many.

This commit is contained in:
Georg Brandl 2010-07-10 10:32:36 +00:00
parent 93eb42e805
commit 0310a83e7f
2 changed files with 5 additions and 4 deletions

View file

@ -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;
}