Skip to content

Commit 35251ff

Browse files
fix: move contextlib import to module top level in pool.py
Was imported inline inside two method bodies, violating PEP 8. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3009f5a commit 35251ff

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/dqliteclient/pool.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Connection pooling for dqlite."""
22

33
import asyncio
4+
import contextlib
45
from collections.abc import AsyncIterator, Sequence
56
from contextlib import asynccontextmanager
67
from typing import Any
@@ -94,8 +95,6 @@ async def acquire(self) -> AsyncIterator[DqliteConnection]:
9495
yield conn
9596
except BaseException:
9697
# On error (including cancellation), close connection
97-
import contextlib
98-
9998
with contextlib.suppress(BaseException):
10099
await conn.close()
101100
self._in_use.discard(conn)
@@ -139,8 +138,6 @@ async def close(self) -> None:
139138

140139
# Close in-use connections
141140
for conn in list(self._in_use):
142-
import contextlib
143-
144141
with contextlib.suppress(Exception):
145142
await conn.close()
146143
self._in_use.clear()

0 commit comments

Comments
 (0)