Ticket #2772: patch_to_sqlite3_base.diff
File patch_to_sqlite3_base.diff, 894 bytes (added by , 18 years ago) |
---|
-
db/backends/sqlite3/base.py
3 3 """ 4 4 5 5 from django.db.backends import util 6 from sys import hexversion 7 8 modname = 'sqlite3' 6 9 try: 7 from pysqlite2 import dbapi2 as Database 10 if hexversion < 0x020500a1: 11 modname = 'pysqlite2' 12 from pysqlite2 import dbapi2 as Database 13 else: 14 from sqlite3 import dbapi2 as Database 8 15 except ImportError, e: 9 16 from django.core.exceptions import ImproperlyConfigured 10 raise ImproperlyConfigured, "Error loading pysqlite2 module: %s" % e 17 raise ImproperlyConfigured, "Error loading %s module: %s" % (modname, e) 18 del modname 11 19 20 12 21 DatabaseError = Database.DatabaseError 13 22 14 23 Database.register_converter("bool", lambda s: str(s) == '1')