X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/78716ab8b9c7b0a643a8dff6364ddeb1251cdc37..2dafc4cf4fc46ea4be293a458d565fbff645ac28:/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