From a31c1a1722d26d4748ca2c32b4207df865f6967b Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 6 Mar 2014 17:49:24 +0000 Subject: [PATCH] Allow get_transaction_status on closed connections It's a local operation and the libpq functions has a NULL guard. --- NEWS | 1 + psycopg/connection_type.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/NEWS b/NEWS index d236eee6..b229795d 100644 --- a/NEWS +++ b/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 the superclass init (:ticket:`#195`). - 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. diff --git a/psycopg/connection_type.c b/psycopg/connection_type.c index 2de1d24d..cb47b662 100644 --- a/psycopg/connection_type.c +++ b/psycopg/connection_type.c @@ -700,8 +700,6 @@ psyco_conn_set_client_encoding(connectionObject *self, PyObject *args) static PyObject * psyco_conn_get_transaction_status(connectionObject *self) { - EXC_IF_CONN_CLOSED(self); - return PyInt_FromLong((long)PQtransactionStatus(self->pgconn)); }