Fixed #26613 -- Made sqlite3 optional in SchemaEditor.quote_value().
This commit is contained in:
parent
5f23f904af
commit
3630b49b55
|
@ -36,9 +36,11 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
|
||||||
# The backend "mostly works" without this function and there are use
|
# The backend "mostly works" without this function and there are use
|
||||||
# cases for compiling Python without the sqlite3 libraries (e.g.
|
# cases for compiling Python without the sqlite3 libraries (e.g.
|
||||||
# security hardening).
|
# security hardening).
|
||||||
import sqlite3
|
|
||||||
try:
|
try:
|
||||||
|
import sqlite3
|
||||||
value = sqlite3.adapt(value)
|
value = sqlite3.adapt(value)
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
except sqlite3.ProgrammingError:
|
except sqlite3.ProgrammingError:
|
||||||
pass
|
pass
|
||||||
# Manual emulation of SQLite parameter quoting
|
# Manual emulation of SQLite parameter quoting
|
||||||
|
|
Loading…
Reference in New Issue