Kaydet (Commit) 9a9c4360 authored tarafından Raymond Hettinger's avatar Raymond Hettinger

PyObject_IsTrue() can return an error condition.

Adding code to handle it properly.
üst 863983e8
......@@ -213,6 +213,7 @@ random_seed(RandomObject *self, PyObject *args)
unsigned long *key = NULL;
unsigned long keymax; /* # of allocated slots in key */
unsigned long keyused; /* # of used slots in key */
int err;
PyObject *arg = NULL;
......@@ -261,11 +262,13 @@ random_seed(RandomObject *self, PyObject *args)
thirtytwo = PyInt_FromLong(32L);
if (thirtytwo == NULL)
goto Done;
while (PyObject_IsTrue(n)) {
while ((err=PyObject_IsTrue(n))) {
PyObject *newn;
PyObject *pychunk;
unsigned long chunk;
if (err == -1)
goto Done;
pychunk = PyNumber_And(n, masklower);
if (pychunk == NULL)
goto Done;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment