X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/5e477e3b5b99da6fc4e54749d4671a6fc8fdcd66..8f88613a6b09745182b2d30709ee915be1a294ba:/nominatim/db/connection.py?ds=sidebyside diff --git a/nominatim/db/connection.py b/nominatim/db/connection.py index 44a293d4..77d463d8 100644 --- a/nominatim/db/connection.py +++ b/nominatim/db/connection.py @@ -189,7 +189,7 @@ def connect(dsn: str) -> ConnectionContext: try: conn = psycopg2.connect(dsn, connection_factory=Connection) ctxmgr = cast(ConnectionContext, contextlib.closing(conn)) - ctxmgr.connection = cast(Connection, conn) + ctxmgr.connection = conn return ctxmgr except psycopg2.OperationalError as err: raise UsageError(f"Cannot connect to database: {err}") from err