Skip to content

Commit

Permalink
dbcore: bail out if the database does't support multi-threading
Browse files Browse the repository at this point in the history
which we rely on. This test doesn't actually work for Python < 3.11,
since Python used to hardcode the threadsafety value to 1
  • Loading branch information
wisp3rwind committed May 7, 2023
1 parent 7169ac8 commit 89b7e1d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions beets/dbcore/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 89b7e1d

Please sign in to comment.