Skip to content

Commit b886518

Browse files
Cycle 13: lift dqliteclient.exceptions import to module level
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 76a84c8 commit b886518

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/dqlitedbapi/aio/connection.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import math
66
from typing import Any
77

8+
import dqliteclient.exceptions as _client_exc
89
from dqliteclient import DqliteConnection
910
from dqlitedbapi.aio.cursor import AsyncCursor
1011
from dqlitedbapi.exceptions import InterfaceError, OperationalError
@@ -121,8 +122,6 @@ async def commit(self) -> None:
121122
raise InterfaceError("Connection is closed")
122123
if self._async_conn is None:
123124
return
124-
import dqliteclient.exceptions as _client_exc
125-
126125
_, op_lock = self._ensure_locks()
127126
async with op_lock:
128127
try:
@@ -137,8 +136,6 @@ async def rollback(self) -> None:
137136
raise InterfaceError("Connection is closed")
138137
if self._async_conn is None:
139138
return
140-
import dqliteclient.exceptions as _client_exc
141-
142139
_, op_lock = self._ensure_locks()
143140
async with op_lock:
144141
try:

src/dqlitedbapi/connection.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import weakref
99
from typing import Any
1010

11+
import dqliteclient.exceptions as _client_exc
1112
from dqliteclient import DqliteConnection
1213
from dqlitedbapi.cursor import Cursor
1314
from dqlitedbapi.exceptions import InterfaceError, OperationalError, ProgrammingError
@@ -259,8 +260,6 @@ def commit(self) -> None:
259260
async def _commit_async(self) -> None:
260261
"""Async implementation of commit."""
261262
assert self._async_conn is not None
262-
import dqliteclient.exceptions as _client_exc
263-
264263
try:
265264
await self._async_conn.execute("COMMIT")
266265
except (OperationalError, _client_exc.OperationalError) as e:
@@ -283,8 +282,6 @@ def rollback(self) -> None:
283282
async def _rollback_async(self) -> None:
284283
"""Async implementation of rollback."""
285284
assert self._async_conn is not None
286-
import dqliteclient.exceptions as _client_exc
287-
288285
try:
289286
await self._async_conn.execute("ROLLBACK")
290287
except (OperationalError, _client_exc.OperationalError) as e:

0 commit comments

Comments
 (0)