mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #15604: Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
This commit is contained in:
commit
721738fbee
10 changed files with 76 additions and 74 deletions
|
@ -429,9 +429,11 @@ filter_next(filterobject *lz)
|
|||
ok = PyObject_IsTrue(good);
|
||||
Py_DECREF(good);
|
||||
}
|
||||
if (ok)
|
||||
if (ok > 0)
|
||||
return item;
|
||||
Py_DECREF(item);
|
||||
if (ok < 0)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue