mirror of
https://github.com/python/cpython.git
synced 2025-09-13 12:17:24 +00:00
Patch #1682205: a TypeError while unpacking an iterable is no longer
masked by a generic one with the message "unpack non-sequence".
This commit is contained in:
parent
aa754b70b0
commit
5cb76c19ba
3 changed files with 7 additions and 6 deletions
|
@ -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.6 alpha 1?
|
||||||
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".
|
||||||
|
|
||||||
- Remove unused file Python/fmod.c.
|
- Remove unused file Python/fmod.c.
|
||||||
|
|
||||||
- Patch #1675423: PyComplex_AsCComplex() now tries to convert an object
|
- Patch #1675423: PyComplex_AsCComplex() now tries to convert an object
|
||||||
|
|
|
@ -1774,12 +1774,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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue