diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-08-15 21:20:39 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-08-15 21:20:39 (GMT) |
commit | 721738fbee8d75dab5a5d3c4f3dbd7c72d76925e (patch) | |
tree | c0e693ed7f2e6c44d48555f3cc4d8775ac8e14bb /Python | |
parent | 9351117139363f3e600c541bc88139702a055db8 (diff) | |
parent | 6f430e496339aea3e688165340456b555d5e1035 (diff) | |
download | cpython-721738fbee8d75dab5a5d3c4f3dbd7c72d76925e.zip cpython-721738fbee8d75dab5a5d3c4f3dbd7c72d76925e.tar.gz cpython-721738fbee8d75dab5a5d3c4f3dbd7c72d76925e.tar.bz2 |
Issue #15604: Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
Diffstat (limited to 'Python')
-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 88b48c0..4a98b03 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; } } |