diff -r fa344eb7dd92 django/db/backends/sqlite3/base.py
a
|
b
|
|
3 | 3 | |
4 | 4 | Python 2.3 and 2.4 require pysqlite2 (http://pysqlite.org/). |
5 | 5 | |
6 | | Python 2.5 and later use the sqlite3 module in the standard library. |
| 6 | Python 2.5 and later can use a pysqlite2 module or the sqlite3 module in the |
| 7 | standard library. |
7 | 8 | """ |
8 | 9 | |
9 | 10 | from django.db.backends import * |
… |
… |
|
14 | 15 | |
15 | 16 | try: |
16 | 17 | try: |
| 18 | from pysqlite2 import dbapi2 as Database |
| 19 | except ImportError, e1: |
17 | 20 | from sqlite3 import dbapi2 as Database |
18 | | except ImportError, e1: |
19 | | from pysqlite2 import dbapi2 as Database |
20 | 21 | except ImportError, exc: |
21 | 22 | import sys |
22 | 23 | from django.core.exceptions import ImproperlyConfigured |
23 | 24 | if sys.version_info < (2, 5, 0): |
24 | | module = 'pysqlite2' |
| 25 | module = 'pysqlite2 module' |
| 26 | exc = e1 |
25 | 27 | else: |
26 | | module = 'sqlite3' |
27 | | exc = e1 |
28 | | raise ImproperlyConfigured, "Error loading %s module: %s" % (module, exc) |
| 28 | module = 'either pysqlite2 or sqlite3 modules (tried in that order)' |
| 29 | raise ImproperlyConfigured, "Error loading %s: %s" % (module, exc) |
29 | 30 | |
30 | 31 | try: |
31 | 32 | import decimal |