mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-25 18:33:44 +03:00
Check return code from decoding the connection status
It fails on Py3 after receiving a SIGABRT. Because we don't handle it here it will resurface later with nonsense such as: SystemError: <some function> returned a result with an error set Close #551
This commit is contained in:
parent
de843ef756
commit
602c74faa6
1
NEWS
1
NEWS
|
@ -18,6 +18,7 @@ What's new in psycopg 2.7.2
|
||||||
(:ticket:`#545`).
|
(:ticket:`#545`).
|
||||||
- Fixed `~psycopg2.extras.ReplicationCursor.consume_stream()`
|
- Fixed `~psycopg2.extras.ReplicationCursor.consume_stream()`
|
||||||
*keepalive_interval* argument (:ticket:`#547`).
|
*keepalive_interval* argument (:ticket:`#547`).
|
||||||
|
- Fixed random `!SystemError` upon receiving abort signal (:ticket:`#551`).
|
||||||
- `~psycopg2.errorcodes` map updated to PostgreSQL 10 beta 1.
|
- `~psycopg2.errorcodes` map updated to PostgreSQL 10 beta 1.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1893,8 +1893,12 @@ pq_fetch(cursorObject *curs, int no_result)
|
||||||
Dprintf("pq_fetch: pgstatus = %s", PQresStatus(pgstatus));
|
Dprintf("pq_fetch: pgstatus = %s", PQresStatus(pgstatus));
|
||||||
|
|
||||||
/* backend status message */
|
/* backend status message */
|
||||||
Py_XDECREF(curs->pgstatus);
|
Py_CLEAR(curs->pgstatus);
|
||||||
curs->pgstatus = conn_text_from_chars(curs->conn, PQcmdStatus(curs->pgres));
|
if (!(curs->pgstatus = conn_text_from_chars(
|
||||||
|
curs->conn, PQcmdStatus(curs->pgres)))) {
|
||||||
|
ex = -1;
|
||||||
|
return ex;
|
||||||
|
}
|
||||||
|
|
||||||
switch(pgstatus) {
|
switch(pgstatus) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user