From 8b13b3ede270bf6f7bf3427675e335ab0bd0f75b Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Sun, 30 Sep 2001 05:58:42 +0000 Subject: 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". --- Python/ceval.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Python/ceval.c') diff --git a/Python/ceval.c b/Python/ceval.c index 731e93fa83..132fb726a6 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1556,8 +1556,12 @@ eval_frame(PyFrameObject *f) 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; -- cgit v1.2.1