Fix a premature import when patching SQLite compatibility.

Review Request #12414 — Created June 24, 2022 and submitted

Information

Django Evolution
master

Reviewers

We provide a compatibility patch that fixes certain versions of SQLite
with Django prior to 2.1.5.

This patch made the assumption that it could import the Django SQLite
backend at the module level, since SQLite is built into Python. However,
on modern versions of Django, this will fail to import if the version of
SQLite is too old.

We now import this only if we're about to apply the patch, in which case
we've already confirmed the compatible version range.

Tested on reviews.reviewboard.org, where this problem was first encountered
due to an older SQLite. We no longer hit a premature import.

Summary ID
Fix a premature import when patching SQLite compatibility.
We provide a compatibility patch that fixes certain versions of SQLite with Django prior to 2.1.5. This patch made the assumption that it could import the Django SQLite backend at the module level, since SQLite is built into Python. However, on modern versions of Django, this will fail to import if the version of SQLite is too old. We now import this only if we're about to apply the patch, in which case we've already confirmed the compatible version range.
4ba73bb33c7e6beecf392d9ab1b6603665a55d77
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.x (3b10597)