Ticket #2772: patch_to_sqlite3_base.diff

File patch_to_sqlite3_base.diff, 894 bytes (added by Yasushi Masuda, 18 years ago)

patch to trunk/django/db/backends/sqlite3/base.py

  • db/backends/sqlite3/base.py

     
    33"""
    44
    55from django.db.backends import util
     6from sys import hexversion
     7
     8modname = 'sqlite3'
    69try:
    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
    815except ImportError, e:
    916    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)
     18del modname
    1119
     20
    1221DatabaseError = Database.DatabaseError
    1322
    1423Database.register_converter("bool", lambda s: str(s) == '1')
Back to Top