mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
don't ignore exceptions from _PyObject_LengthHint
This commit is contained in:
parent
a7dc949e17
commit
4c1fe51ca0
1 changed files with 3 additions and 1 deletions
|
|
@ -2383,8 +2383,10 @@ builtin_zip(PyObject *self, PyObject *args)
|
|||
len = -1; /* unknown */
|
||||
for (i = 0; i < itemsize; ++i) {
|
||||
PyObject *item = PyTuple_GET_ITEM(args, i);
|
||||
Py_ssize_t thislen = _PyObject_LengthHint(item, -1);
|
||||
Py_ssize_t thislen = _PyObject_LengthHint(item, -2);
|
||||
if (thislen < 0) {
|
||||
if (thislen == -1)
|
||||
return NULL;
|
||||
len = -1;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue