From: Daniele Varrazzo Date: Thu, 3 Nov 2022 23:09:29 +0000 (+0100) Subject: fix: fix check for empty notice handlers list X-Git-Tag: pool-3.1.4~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f77c4dcfb5f3051197b8453711d643b3770198ac;p=thirdparty%2Fpsycopg.git fix: fix check for empty notice handlers list Issue reported by Mypy 0.990. Thank you! --- diff --git a/psycopg/psycopg/connection.py b/psycopg/psycopg/connection.py index 5f98dbc6e..d40b4807f 100644 --- a/psycopg/psycopg/connection.py +++ b/psycopg/psycopg/connection.py @@ -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))