mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-07 21:00:33 +03:00
Make connection.executing() be True during an async connection attempt.
This commit is contained in:
parent
463724690c
commit
5f4ef5da13
|
@ -572,14 +572,27 @@ psyco_conn_issync(connectionObject *self)
|
||||||
static PyObject *
|
static PyObject *
|
||||||
psyco_conn_executing(connectionObject *self)
|
psyco_conn_executing(connectionObject *self)
|
||||||
{
|
{
|
||||||
if (self->async_cursor == NULL) {
|
/* synchronous connections will always return False */
|
||||||
|
if (self->async == 0) {
|
||||||
Py_INCREF(Py_False);
|
Py_INCREF(Py_False);
|
||||||
return Py_False;
|
return Py_False;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
|
/* check if the connection is still being built */
|
||||||
|
if (self->status != CONN_STATUS_READY) {
|
||||||
Py_INCREF(Py_True);
|
Py_INCREF(Py_True);
|
||||||
return Py_True;
|
return Py_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* check if there is a query being executed */
|
||||||
|
if (self->async_cursor != NULL) {
|
||||||
|
Py_INCREF(Py_True);
|
||||||
|
return Py_True;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* otherwise it's not executing */
|
||||||
|
Py_INCREF(Py_False);
|
||||||
|
return Py_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** the connection object **/
|
/** the connection object **/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user