mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-30 04:33:45 +03:00
'poll()' can raise a Python exception in case of error.
This commit is contained in:
parent
442b3b2f6c
commit
55270cab9f
|
@ -724,7 +724,12 @@ conn_poll_green(connectionObject *self)
|
|||
res = PSYCO_POLL_ERROR;
|
||||
}
|
||||
|
||||
return PyInt_FromLong(res);
|
||||
if (!(res == PSYCO_POLL_ERROR && PyErr_Occurred())) {
|
||||
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 */
|
||||
|
|
Loading…
Reference in New Issue
Block a user