Repository navigation
Conversation
The fallback compared the failing import's name against sqlite3 and _sqlite3, the CPython chain only. PyPy's _sqlite3 is pure Python and imports the binding _sqlite3_cffi, which its build leaves out when the SQLite headers are missing, so ReadWriteLock would have raised there where it had been None. The check now accepts any name in the sqlite3 or _sqlite3 family. Coverage now measures the raise path instead of excluding it: the pragma moved from the except clause to the None assignment, the one line a runtime with sqlite3 cannot reach, and the missing-module cases run under coverage.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An application frozen with PyInstaller or Nuitka that leaves out
filelock._read_writesawfilelock.ReadWriteLockresolve toNoneand failed later with aTypeErrorthat never named filelock. The lazy loader treated everyImportErrorfrom the read-write modules as the documented no-SQLite fallback. Fixes #879.The loader keeps that fallback for one cause: the
ImportErrornames Python'ssqlite3package or one of its bindings, CPython's_sqlite3or PyPy's_sqlite3_cffi, which a PyPy build leaves out without the SQLite headers. Any other missing module, a filelock submodule the freezer dropped included, raises at the first access with that module's name.Resolving
ReadWriteLockorAsyncReadWriteLockon an interpreter without SQLite still givesNone.