From: Daniele Varrazzo Date: Tue, 17 May 2022 19:24:45 +0000 (+0200) Subject: style: import PipelineStatus members in the module like for other pq enums X-Git-Tag: 3.1~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cf8815405b5024b1818a645e5f35fad73230403;p=thirdparty%2Fpsycopg.git style: import PipelineStatus members in the module like for other pq enums --- diff --git a/psycopg/psycopg/connection.py b/psycopg/psycopg/connection.py index d96ef1aef..997af7b66 100644 --- a/psycopg/psycopg/connection.py +++ b/psycopg/psycopg/connection.py @@ -68,6 +68,7 @@ FATAL_ERROR = pq.ExecStatus.FATAL_ERROR IDLE = pq.TransactionStatus.IDLE INTRANS = pq.TransactionStatus.INTRANS +ABORTED = pq.PipelineStatus.ABORTED logger = logging.getLogger("psycopg") @@ -556,7 +557,7 @@ class BaseConnection(Generic[Row]): ) # Get out of a "pipeline aborted" state - if self._pipeline and self.pgconn.pipeline_status == pq.PipelineStatus.ABORTED: + if self._pipeline and self.pgconn.pipeline_status == ABORTED: yield from self._pipeline._sync_gen() if self.pgconn.transaction_status == IDLE: