From 3630b49b556785af63077407418296ada31b0b3e Mon Sep 17 00:00:00 2001 From: Philip Liberato Date: Mon, 16 May 2016 19:43:07 -0400 Subject: [PATCH] Fixed #26613 -- Made sqlite3 optional in SchemaEditor.quote_value(). --- django/db/backends/sqlite3/schema.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/django/db/backends/sqlite3/schema.py b/django/db/backends/sqlite3/schema.py index 9d9eb3c3ba..f72357e459 100644 --- a/django/db/backends/sqlite3/schema.py +++ b/django/db/backends/sqlite3/schema.py @@ -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