mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-26 10:53:44 +03:00
Allow get_transaction_status on closed connections
It's a local operation and the libpq functions has a NULL guard.
This commit is contained in:
parent
9036299d54
commit
a31c1a1722
1
NEWS
1
NEWS
|
@ -28,6 +28,7 @@ What's new in psycopg 2.5.3
|
||||||
- Don't segfault using poorly defined cursor subclasses which forgot to call
|
- Don't segfault using poorly defined cursor subclasses which forgot to call
|
||||||
the superclass init (:ticket:`#195`).
|
the superclass init (:ticket:`#195`).
|
||||||
- Fixed possible segfault in named cursors creation.
|
- Fixed possible segfault in named cursors creation.
|
||||||
|
- It is now possible to call `get_transaction_status()` on closed connections.
|
||||||
- Fixed debug build on Windows, thanks to James Emerton.
|
- Fixed debug build on Windows, thanks to James Emerton.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -700,8 +700,6 @@ psyco_conn_set_client_encoding(connectionObject *self, PyObject *args)
|
||||||
static PyObject *
|
static PyObject *
|
||||||
psyco_conn_get_transaction_status(connectionObject *self)
|
psyco_conn_get_transaction_status(connectionObject *self)
|
||||||
{
|
{
|
||||||
EXC_IF_CONN_CLOSED(self);
|
|
||||||
|
|
||||||
return PyInt_FromLong((long)PQtransactionStatus(self->pgconn));
|
return PyInt_FromLong((long)PQtransactionStatus(self->pgconn));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user