Fixed #9113 -- Improved exception message reporting when importing sqlite3 fails.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9060 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
168c776889
commit
e99cd48769
|
@ -14,16 +14,17 @@ from django.db.backends.sqlite3.introspection import DatabaseIntrospection
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
from sqlite3 import dbapi2 as Database
|
from sqlite3 import dbapi2 as Database
|
||||||
except ImportError:
|
except ImportError, e1:
|
||||||
from pysqlite2 import dbapi2 as Database
|
from pysqlite2 import dbapi2 as Database
|
||||||
except ImportError, e:
|
except ImportError, exc:
|
||||||
import sys
|
import sys
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
if sys.version_info < (2, 5, 0):
|
if sys.version_info < (2, 5, 0):
|
||||||
module = 'pysqlite2'
|
module = 'pysqlite2'
|
||||||
else:
|
else:
|
||||||
module = 'sqlite3'
|
module = 'sqlite3'
|
||||||
raise ImproperlyConfigured, "Error loading %s module: %s" % (module, e)
|
exc = e1
|
||||||
|
raise ImproperlyConfigured, "Error loading %s module: %s" % (module, exc)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import decimal
|
import decimal
|
||||||
|
|
Loading…
Reference in New Issue