diff Python/bltinmodule.c @ 78604:56dc7b09f390 3.2

Issue #15604: Update uses of PyObject_IsTrue() to check for and handle errors correctly. Patch by Serhiy Storchaka.
author Antoine Pitrou <solipsis@pitrou.net>
date Wed, 15 Aug 2012 23:18:25 +0200
parents ba01cf9a8578
children d5ee1a06101f b878df1d23b1
line wrap: on
line diff
--- a/Python/bltinmodule.c	Wed Aug 15 21:37:35 2012 +0200
+++ b/Python/bltinmodule.c	Wed Aug 15 23:18:25 2012 +0200
@@ -428,9 +428,11 @@
             ok = PyObject_IsTrue(good);
             Py_DECREF(good);
         }
-        if (ok)
+        if (ok > 0)
             return item;
         Py_DECREF(item);
+        if (ok < 0)
+            return NULL;
     }
 }