'poll()' can raise a Python exception in case of error.

This commit is contained in:
Daniele Varrazzo 2010-04-03 22:32:37 +01:00
parent 442b3b2f6c
commit 55270cab9f

View File

@ -724,7 +724,12 @@ conn_poll_green(connectionObject *self)
res = PSYCO_POLL_ERROR; res = PSYCO_POLL_ERROR;
} }
if (!(res == PSYCO_POLL_ERROR && PyErr_Occurred())) {
return PyInt_FromLong(res); return PyInt_FromLong(res);
} else {
/* There is an error and an exception is already in place */
return NULL;
}
} }
/* conn_close - do anything needed to shut down the connection */ /* conn_close - do anything needed to shut down the connection */