diff -r 7d7a2c721366 Lib/test/test_unpack.py --- a/Lib/test/test_unpack.py Wed Apr 15 10:09:10 2015 -0400 +++ b/Lib/test/test_unpack.py Wed Apr 15 12:38:10 2015 -0400 @@ -76,7 +76,7 @@ >>> a, b, c, d = Seq() Traceback (most recent call last): ... - ValueError: need more than 3 values to unpack + ValueError: not enough values to unpack (expected 4, got 3) Unpacking sequence too long diff -r 7d7a2c721366 Lib/test/test_unpack_ex.py --- a/Lib/test/test_unpack_ex.py Wed Apr 15 10:09:10 2015 -0400 +++ b/Lib/test/test_unpack_ex.py Wed Apr 15 12:38:10 2015 -0400 @@ -85,7 +85,7 @@ >>> 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 a sequence where the test for too long raises a different kind of error diff -r 7d7a2c721366 Python/ceval.c --- a/Python/ceval.c Wed Apr 15 10:09:10 2015 -0400 +++ b/Python/ceval.c Wed Apr 15 12:38:10 2015 -0400 @@ -3826,8 +3826,8 @@ /* Iterator done, via error or exhaustion. */ if (!PyErr_Occurred()) { PyErr_Format(PyExc_ValueError, - "need more than %d value%s to unpack", - i, i == 1 ? "" : "s"); + "not enough values to unpack (expected %d, got %d)", + argcnt, i); } goto Error; } @@ -3844,8 +3844,9 @@ return 1; } Py_DECREF(w); - PyErr_Format(PyExc_ValueError, "too many values to unpack " - "(expected %d)", argcnt); + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %d)", + argcnt); goto Error; } @@ -3857,8 +3858,9 @@ ll = PyList_GET_SIZE(l); if (ll < argcntafter) { - PyErr_Format(PyExc_ValueError, "need more than %zd values to unpack", - argcnt + ll); + PyErr_Format(PyExc_ValueError, + "not enough values to unpack (expected at least %d, got %zd)", + argcnt + argcntafter, i - 1 + ll); goto Error; }