X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/fd4ab3f262b0589f8c6fe475d166b412ac5beb76..3bcd32ca2006cb2184f290e18f4e054f8aca8bf4:/nominatim/db/connection.py?ds=sidebyside diff --git a/nominatim/db/connection.py b/nominatim/db/connection.py index 45bc173d..c60bcfdd 100644 --- a/nominatim/db/connection.py +++ b/nominatim/db/connection.py @@ -25,7 +25,8 @@ class _Cursor(psycopg2.extras.DictCursor): execution functions. """ - def execute(self, query, args=None): # pylint: disable=W0221 + # pylint: disable=arguments-renamed,arguments-differ + def execute(self, query, args=None): """ Query execution that logs the SQL query when debugging is enabled. """ LOG.debug(self.mogrify(query, args).decode('utf-8')) @@ -163,7 +164,7 @@ def connect(dsn): ctxmgr.connection = conn return ctxmgr except psycopg2.OperationalError as err: - raise UsageError("Cannot connect to database: {}".format(err)) from err + raise UsageError(f"Cannot connect to database: {err}") from err # Translation from PG connection string parameters to PG environment variables.