mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-23 01:16:34 +03:00
Work around a false positive returned by the static checker
To be submitted to the author.
This commit is contained in:
parent
a167822e26
commit
9432787279
|
@ -956,9 +956,10 @@ pq_execute(cursorObject *curs, const char *query, int async)
|
|||
if (pq_fetch(curs) < 0) return -1;
|
||||
}
|
||||
else {
|
||||
PyObject *tmp;
|
||||
curs->conn->async_status = async_status;
|
||||
curs->conn->async_cursor = PyWeakref_NewRef((PyObject *)curs, NULL);
|
||||
if (!curs->conn->async_cursor) {
|
||||
curs->conn->async_cursor = tmp = PyWeakref_NewRef((PyObject *)curs, NULL);
|
||||
if (!tmp) {
|
||||
/* weakref creation failed */
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user