]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
fix: fix check for empty notice handlers list
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 3 Nov 2022 23:09:29 +0000 (00:09 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 3 Nov 2022 23:09:29 +0000 (00:09 +0100)
Issue reported by Mypy 0.990. Thank you!

psycopg/psycopg/connection.py

index 5f98dbc6ed580e91a54ef183ed78a9406db0862b..d40b4807f35d6d889664464f18a9742fd6ba5b9e 100644 (file)
@@ -335,7 +335,7 @@ class BaseConnection(Generic[Row]):
         wself: "ReferenceType[BaseConnection[Row]]", res: "PGresult"
     ) -> None:
         self = wself()
-        if not (self and self._notice_handler):
+        if not (self and self._notice_handlers):
             return
 
         diag = e.Diagnostic(res, pgconn_encoding(self.pgconn))