]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
refactor(copy) use already looked-up pgconn instead of the connection one
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 11 Jun 2022 08:46:01 +0000 (10:46 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 19 Jul 2022 11:09:44 +0000 (12:09 +0100)
Left out of previous refactoring.

psycopg/psycopg/copy.py

index a93ff8751ca8a7ba8ce7616fd450e7b7f6644a5a..ffa5067ef3c4b977af83f5a3fe8ad8274f8e5d2e 100644 (file)
@@ -178,7 +178,7 @@ class BaseCopy(Generic[ConnectionType]):
         if not exc:
             return
 
-        if self.connection.pgconn.transaction_status != ACTIVE:
+        if self._pgconn.transaction_status != ACTIVE:
             # The server has already finished to send copy data. The connection
             # is already in a good state.
             return