diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-08-15 23:20:39 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-08-15 23:20:39 +0200 |
commit | 721738fbee8d75dab5a5d3c4f3dbd7c72d76925e (patch) | |
tree | c0e693ed7f2e6c44d48555f3cc4d8775ac8e14bb /Python/bltinmodule.c | |
parent | merge heads (diff) | |
parent | Issue #15604: Update uses of PyObject_IsTrue() to check for and handle errors... (diff) | |
download | cpython-721738fbee8d75dab5a5d3c4f3dbd7c72d76925e.tar.gz cpython-721738fbee8d75dab5a5d3c4f3dbd7c72d76925e.tar.bz2 cpython-721738fbee8d75dab5a5d3c4f3dbd7c72d76925e.zip |
Issue #15604: Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 88b48c0fa68..4a98b032cfa 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -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; } } |