diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2012-02-29 23:53:00 +0000 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2012-03-01 02:53:28 +0000 |
commit | 94327872790cc1649cfe08165d111aa25f045f03 (patch) | |
tree | ba2cd4b2a100139dc2de737332b1935242348dcd /psycopg | |
parent | a167822e2692a8372d4cbe4570a3616cbd57ff6b (diff) | |
download | psycopg2-94327872790cc1649cfe08165d111aa25f045f03.tar.gz |
Work around a false positive returned by the static checker
To be submitted to the author.
Diffstat (limited to 'psycopg')
-rw-r--r-- | psycopg/pqpath.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/psycopg/pqpath.c b/psycopg/pqpath.c index 816adb2..e850699 100644 --- a/psycopg/pqpath.c +++ b/psycopg/pqpath.c @@ -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; } |