Skip to content

Commit 1368d0e

Browse files
committed
Fix spurious error following mypy 1.16 update.
1 parent c53b2de commit 1368d0e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/reader/_storage/_sqlite_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from datetime import datetime
2424
from datetime import timezone
2525
from typing import Any
26+
from typing import cast
2627
from typing import no_type_check
2728
from typing import TypeVar
2829

@@ -471,8 +472,9 @@ def __call__(self) -> sqlite3.Connection:
471472
if not self._local.is_creating_thread:
472473
self._other_threads = True
473474

474-
self._local.db = db = sqlite3.connect(self.path, **self.kwargs)
475-
assert db is not None, "for mypy"
475+
# TODO: remove needless cast (needed after mypy 1.16.0 update)
476+
db = cast(sqlite3.Connection, sqlite3.connect(self.path, **self.kwargs))
477+
self._local.db = db
476478
self._local.call_count = 0
477479

478480
try:

0 commit comments

Comments
 (0)