From 409 warnings down to 52 warnings.

By closing unclosed database connections.

Refs #2614
This commit is contained in:
Simon Willison 2025-12-12 22:38:04 -08:00
commit f02484c3de
14 changed files with 75 additions and 27 deletions

View file

@ -20,15 +20,16 @@ def sqlite_version():
def _sqlite_version():
return tuple(
map(
int,
sqlite3.connect(":memory:")
.execute("select sqlite_version()")
.fetchone()[0]
.split("."),
conn = sqlite3.connect(":memory:")
try:
return tuple(
map(
int,
conn.execute("select sqlite_version()").fetchone()[0].split("."),
)
)
)
finally:
conn.close()
def supports_table_xinfo():