X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/c314a3092c5b51c7782015f6fa9ac093b46fa174..3cc20581aeac2c263fe1e9f6d4c8ab3e428bea00:/src/nominatim_api/sql/async_core_library.py diff --git a/src/nominatim_api/sql/async_core_library.py b/src/nominatim_api/sql/async_core_library.py index c26846fb..f8e29749 100644 --- a/src/nominatim_api/sql/async_core_library.py +++ b/src/nominatim_api/sql/async_core_library.py @@ -7,15 +7,17 @@ """ Import the base library to use with asynchronous SQLAlchemy. """ -# pylint: disable=invalid-name +# pylint: disable=invalid-name, ungrouped-imports, unused-import from typing import Any try: + import sqlalchemy.dialects.postgresql.psycopg import psycopg PGCORE_LIB = 'psycopg' PGCORE_ERROR: Any = psycopg.Error except ModuleNotFoundError: + import sqlalchemy.dialects.postgresql.asyncpg import asyncpg PGCORE_LIB = 'asyncpg' PGCORE_ERROR = asyncpg.PostgresError