summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-08-15 23:20:39 +0200
committerAntoine Pitrou <solipsis@pitrou.net>2012-08-15 23:20:39 +0200
commitda33e8cdc0c19f4a9e407f4a813fcf76870f35c2 (patch)
tree1f95e72df9d6a969ae7e79759f6c926cbc98c509 /Python
parentf9a713c7f197f14cd0e803ce9e00970a0c52dc07 (diff)
parent1d494aa59c54cdf7d189b6b2e41502da941367b7 (diff)
downloadcpython-da33e8cdc0c19f4a9e407f4a813fcf76870f35c2.tar.gz
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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 88b48c0fa6..4a98b032cf 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;
}
}