Commit 8a10ea46 authored by Georg Brandl's avatar Georg Brandl

Patch #1682205: a TypeError while unpacking an iterable is no longer

masked by a generic one with the message "unpack non-sequence".
 (backport from rev. 54480)
parent f94e89c5
...@@ -55,7 +55,7 @@ Unpacking non-sequence ...@@ -55,7 +55,7 @@ Unpacking non-sequence
>>> a, b, c = 7 >>> a, b, c = 7
Traceback (most recent call last): Traceback (most recent call last):
... ...
TypeError: unpack non-sequence TypeError: 'int' object is not iterable
Unpacking tuple of wrong size Unpacking tuple of wrong size
......
...@@ -12,6 +12,9 @@ What's New in Python 2.5.1c1? ...@@ -12,6 +12,9 @@ What's New in Python 2.5.1c1?
Core and builtins Core and builtins
----------------- -----------------
- Patch #1682205: a TypeError while unpacking an iterable is no longer
masked by a generic one with the message "unpack non-sequence".
- Patch #1642547: Fix an error/crash when encountering syntax errors in - Patch #1642547: Fix an error/crash when encountering syntax errors in
complex if statements. complex if statements.
......
...@@ -1765,12 +1765,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) ...@@ -1765,12 +1765,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
PUSH(w); PUSH(w);
} }
} else if (unpack_iterable(v, oparg, } else if (unpack_iterable(v, oparg,
stack_pointer + oparg)) stack_pointer + oparg)) {
stack_pointer += oparg; stack_pointer += oparg;
else { } else {
if (PyErr_ExceptionMatches(PyExc_TypeError)) /* unpack_iterable() raised an exception */
PyErr_SetString(PyExc_TypeError,
"unpack non-sequence");
why = WHY_EXCEPTION; why = WHY_EXCEPTION;
} }
Py_DECREF(v); Py_DECREF(v);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment