Skip to content

Commit bbbff2f

Browse files
Drop the redundant InterfaceError alias in the cursor module
The dbapi cursor module previously imported InterfaceError twice — once unaliased and once as _DbapiInterfaceError — to disambiguate from _client_exc.InterfaceError inside _call_client. The client-side reference already carries the _client_exc. module prefix, so the alias adds no disambiguation and just costs a reader a double-take. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d40e328 commit bbbff2f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/dqlitedbapi/cursor.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
OperationalError,
1212
ProgrammingError,
1313
)
14-
from dqlitedbapi.exceptions import (
15-
InterfaceError as _DbapiInterfaceError,
16-
)
1714
from dqlitedbapi.types import (
1815
_convert_bind_param,
1916
_datetime_from_iso8601,
@@ -53,16 +50,16 @@ async def _call_client(coro: Coroutine[Any, Any, Any]) -> Any:
5350
except _client_exc.ClusterError as e:
5451
raise OperationalError(str(e)) from e
5552
except _client_exc.ProtocolError as e:
56-
raise _DbapiInterfaceError(str(e)) from e
53+
raise InterfaceError(str(e)) from e
5754
except _client_exc.DataError as e:
5855
raise DataError(str(e)) from e
5956
except _client_exc.InterfaceError as e:
60-
raise _DbapiInterfaceError(str(e)) from e
57+
raise InterfaceError(str(e)) from e
6158
except _client_exc.DqliteError as e:
6259
# Catch-all for any future subclass of DqliteError not enumerated
6360
# above. Surface as InterfaceError rather than leaking to the
6461
# caller as a non-DBAPI exception.
65-
raise _DbapiInterfaceError(f"unrecognized client error ({type(e).__name__}): {e}") from e
62+
raise InterfaceError(f"unrecognized client error ({type(e).__name__}): {e}") from e
6663

6764

6865
if TYPE_CHECKING:

0 commit comments

Comments
 (0)