]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/db/connection.py
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / nominatim / db / connection.py
index 45bc173d4659177cba65e7e96886286568895dcb..c60bcfddb8af99faf3bc2ba4e7f7a48b7baf731f 100644 (file)
@@ -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.