mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-12-02 13:43:44 +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;
|
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 */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user