]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
style: import PipelineStatus members in the module like for other pq enums
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 17 May 2022 19:24:45 +0000 (21:24 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 17 May 2022 19:28:29 +0000 (21:28 +0200)
psycopg/psycopg/connection.py

index d96ef1aef5003050c869c0c024278d4f1e845ded..997af7b66b2de05958885924e43228d84ccf3d49 100644 (file)
@@ -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: