0
0
mirror of https://github.com/django/django.git synced 2024-11-29 14:46:18 +01:00

Fixed #26613 -- Made sqlite3 optional in SchemaEditor.quote_value().

This commit is contained in:
Philip Liberato 2016-05-16 19:43:07 -04:00 committed by Tim Graham
parent 5f23f904af
commit 3630b49b55

View File

@ -36,9 +36,11 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
# The backend "mostly works" without this function and there are use
# cases for compiling Python without the sqlite3 libraries (e.g.
# security hardening).
import sqlite3
try:
import sqlite3
value = sqlite3.adapt(value)
except ImportError:
pass
except sqlite3.ProgrammingError:
pass
# Manual emulation of SQLite parameter quoting