mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-06-27 16:23:08 +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;
|
if (pq_fetch(curs) < 0) return -1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
PyObject *tmp;
|
||||||
curs->conn->async_status = async_status;
|
curs->conn->async_status = async_status;
|
||||||
curs->conn->async_cursor = PyWeakref_NewRef((PyObject *)curs, NULL);
|
curs->conn->async_cursor = tmp = PyWeakref_NewRef((PyObject *)curs, NULL);
|
||||||
if (!curs->conn->async_cursor) {
|
if (!tmp) {
|
||||||
/* weakref creation failed */
|
/* weakref creation failed */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user