aboutsummaryrefslogtreecommitdiff
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
commit721738fbee8d75dab5a5d3c4f3dbd7c72d76925e (patch)
treec0e693ed7f2e6c44d48555f3cc4d8775ac8e14bb /Python/bltinmodule.c
parentmerge heads (diff)
parentIssue #15604: Update uses of PyObject_IsTrue() to check for and handle errors... (diff)
downloadcpython-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.c4
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;
}
}