Visitar URL original
bpo-45613: Set `sqlite3.threadsafety` dynamically by erlend-aasland · Pull Request #29227 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Nitpick
  • Loading branch information
Erlend E. Aasland
Erlend E. Aasland committed Oct 28, 2021
commit d45e27ab40e383288d91ccefbec74df3d9ab437c
6 changes: 3 additions & 3 deletions Lib/sqlite3/dbapi2.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def fetch_compile_options():
del fetch_compile_options

def _threadsafety():
if "THREADSAFE=0" in _compile_options: # SQLite single-thread mode
# Translates to DB-API threadsafety level 0, meaning threads may not
# share the module.
if "THREADSAFE=0" in _compile_options:
# SQLITE_THREADSAFE=0 (single-thread mode) translates to DB-API
# threadsafety level 0, meaning threads may not share the module.
return 0
elif "THREADSAFE=2" in _compile_options:
# SQLITE_THREADSAFE=2 (multi-thread mode) translates to DB-API
Expand Down