mirror of
https://github.com/simonw/datasette.git
synced 2026-09-27 12:24:07 +02:00
From 409 warnings down to 52 warnings.
By closing unclosed database connections. Refs #2614
This commit is contained in:
parent
9c164572d3
commit
f02484c3de
14 changed files with 75 additions and 27 deletions
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue