dbcore: bail out if the database does't support multi-threading

which we rely on. This test doesn't actually work for Python < 3.11,
since Python used to hardcode the threadsafety value to 1
This commit is contained in:
wisp3rwind 2023-05-04 09:40:32 +02:00
parent 7169ac81f5
commit 89b7e1d864

View file

@ -923,6 +923,11 @@ class Database:
"""
def __init__(self, path, timeout=5.0):
if sqlite3.threadsafety == 0:
raise RuntimeError(
"sqlite3 must be compiled with multi-threading support"
)
self.path = path
self.timeout = timeout