From 1b0eb6b9c2099565f816b017cbb1a2a3f77d16b2 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Wed, 30 Jun 2021 17:04:42 +0100 Subject: [PATCH] More terse import error of the requested implementation --- psycopg/psycopg/pq/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/psycopg/psycopg/pq/__init__.py b/psycopg/psycopg/pq/__init__.py index 74c279b92..50773d92e 100644 --- a/psycopg/psycopg/pq/__init__.py +++ b/psycopg/psycopg/pq/__init__.py @@ -51,11 +51,11 @@ def import_from_libpq() -> None: def handle_error(name: str, e: Exception) -> None: if not impl: - msg = f"error importing '{name}' wrapper: {e}" + msg = f"couldn't import psycopg '{name}' implementation: {e}" logger.debug(msg) attempts.append(msg) else: - msg = f"error importing requested '{name}' wrapper: {e}" + msg = f"couldn't import requested psycopg '{name}' implementation: {e}" raise ImportError(msg) from e # The best implementation: fast but requires the system libpq installed @@ -89,7 +89,7 @@ def import_from_libpq() -> None: Escaping = module.Escaping PGcancel = module.PGcancel elif impl: - raise ImportError(f"requested pq impementation '{impl}' unknown") + raise ImportError(f"requested psycopg impementation '{impl}' unknown") else: sattempts = "\n".join(f"- {attempt}" for attempt in attempts) raise ImportError( -- 2.47.3