Skip to content

Commit d40e328

Browse files
Hoist math import to module level in the PEP 249 module
The sync connect() function imported math inside the function body, while the async module's aio/__init__.py imports it at module top. Move the sync import to the top so both modules use the same idiom. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 467a411 commit d40e328

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dqlitedbapi/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""PEP 249 compliant interface for dqlite."""
22

3+
import math
4+
35
from dqlitedbapi.connection import Connection
46
from dqlitedbapi.cursor import Cursor
57
from dqlitedbapi.exceptions import (
@@ -118,8 +120,6 @@ def connect(
118120
Returns:
119121
A Connection object
120122
"""
121-
import math
122-
123123
if not math.isfinite(timeout) or timeout <= 0:
124124
raise ProgrammingError(f"timeout must be a positive finite number, got {timeout}")
125125
return Connection(

0 commit comments

Comments
 (0)