Issue #15604: Update uses of PyObject_IsTrue() to check for and handle errors correctly.

Patch by Serhiy Storchaka.
This commit is contained in:
Antoine Pitrou 2012-08-15 23:20:39 +02:00
commit 721738fbee
10 changed files with 76 additions and 74 deletions

View file

@ -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;
}
}