Mercurial > cpython-lru_cache-weakref
diff Python/ceval.c @ 20183:c6b6189a8397 legacy-trunk
SF bug [#466173] unpack TypeError unclear
Replaced 3 instances of "iter() of non-sequence" with
"iteration over non-sequence".
Restored "unpack non-sequence" for stuff like "a, b = 1".
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Sun, 30 Sep 2001 05:58:42 +0000 |
| parents | 233f9606ba8e |
| children | a4d328d50897 |
line wrap: on
line diff
--- a/Python/ceval.c Sun Sep 30 05:09:37 2001 +0000 +++ b/Python/ceval.c Sun Sep 30 05:58:42 2001 +0000 @@ -1556,8 +1556,12 @@ else if (unpack_iterable(v, oparg, stack_pointer + oparg)) stack_pointer += oparg; - else + else { + if (PyErr_ExceptionMatches(PyExc_TypeError)) + PyErr_SetString(PyExc_TypeError, + "unpack non-sequence"); why = WHY_EXCEPTION; + } Py_DECREF(v); break;
