Author: adrian
Date: 2006-05-26 13:58:46 -0500 (Fri, 26 May 2006)
New Revision: 2993
Modified:
django/trunk/django/db/backends/ado_mssql/base.py
django/trunk/django/db/backends/mysql/base.py
django/trunk/django/db/backends/oracle/base.py
django/trunk/django/db/backends/postgresql/base.py
django/trunk/django/db/backends/postgresql_psycopg2/base.py
django/trunk/django/db/backends/sqlite3/base.py
Log:
Fixed #1673 -- Every database backend now raises ImproperlyConfigured if the
relevant Python database module raises ImportError
Modified: django/trunk/django/db/backends/ado_mssql/base.py
===================================================================
--- django/trunk/django/db/backends/ado_mssql/base.py 2006-05-26 18:41:03 UTC
(rev 2992)
+++ django/trunk/django/db/backends/ado_mssql/base.py 2006-05-26 18:58:46 UTC
(rev 2993)
@@ -5,7 +5,11 @@
"""
from django.db.backends import util
-import adodbapi as Database
+try:
+ import adodbapi as Database
+except ImportError, e:
+ from django.core.exceptions import ImproperlyConfigured
+ raise ImproperlyConfigured, "Error loading adodbapi module: %s" % e
import datetime
try:
import mx
Modified: django/trunk/django/db/backends/mysql/base.py
===================================================================
--- django/trunk/django/db/backends/mysql/base.py 2006-05-26 18:41:03 UTC
(rev 2992)
+++ django/trunk/django/db/backends/mysql/base.py 2006-05-26 18:58:46 UTC
(rev 2993)
@@ -5,7 +5,11 @@
"""
from django.db.backends import util
-import MySQLdb as Database
+try:
+ import MySQLdb as Database
+except ImportError, e:
+ from django.core.exceptions import ImproperlyConfigured
+ raise ImproperlyConfigured, "Error loading MySQLdb module: %s" % e
from MySQLdb.converters import conversions
from MySQLdb.constants import FIELD_TYPE
import types
Modified: django/trunk/django/db/backends/oracle/base.py
===================================================================
--- django/trunk/django/db/backends/oracle/base.py 2006-05-26 18:41:03 UTC
(rev 2992)
+++ django/trunk/django/db/backends/oracle/base.py 2006-05-26 18:58:46 UTC
(rev 2993)
@@ -5,7 +5,11 @@
"""
from django.db.backends import util
-import cx_Oracle as Database
+try:
+ import cx_Oracle as Database
+except ImportError, e:
+ from django.core.exceptions import ImproperlyConfigured
+ raise ImproperlyConfigured, "Error loading cx_Oracle module: %s" % e
import types
DatabaseError = Database.Error
Modified: django/trunk/django/db/backends/postgresql/base.py
===================================================================
--- django/trunk/django/db/backends/postgresql/base.py 2006-05-26 18:41:03 UTC
(rev 2992)
+++ django/trunk/django/db/backends/postgresql/base.py 2006-05-26 18:58:46 UTC
(rev 2993)
@@ -5,7 +5,11 @@
"""
from django.db.backends import util
-import psycopg as Database
+try:
+ import psycopg as Database
+except ImportError, e:
+ from django.core.exceptions import ImproperlyConfigured
+ raise ImproperlyConfigured, "Error loading psycopg module: %s" % e
DatabaseError = Database.DatabaseError
Modified: django/trunk/django/db/backends/postgresql_psycopg2/base.py
===================================================================
--- django/trunk/django/db/backends/postgresql_psycopg2/base.py 2006-05-26
18:41:03 UTC (rev 2992)
+++ django/trunk/django/db/backends/postgresql_psycopg2/base.py 2006-05-26
18:58:46 UTC (rev 2993)
@@ -5,7 +5,11 @@
"""
from django.db.backends import util
-import psycopg2 as Database
+try:
+ import psycopg2 as Database
+except ImportError, e:
+ from django.core.exceptions import ImproperlyConfigured
+ raise ImproperlyConfigured, "Error loading psycopg2 module: %s" % e
DatabaseError = Database.DatabaseError
Modified: django/trunk/django/db/backends/sqlite3/base.py
===================================================================
--- django/trunk/django/db/backends/sqlite3/base.py 2006-05-26 18:41:03 UTC
(rev 2992)
+++ django/trunk/django/db/backends/sqlite3/base.py 2006-05-26 18:58:46 UTC
(rev 2993)
@@ -3,7 +3,11 @@
"""
from django.db.backends import util
-from pysqlite2 import dbapi2 as Database
+try:
+ from pysqlite2 import dbapi2 as Database
+except ImportError, e:
+ from django.core.exceptions import ImproperlyConfigured
+ raise ImproperlyConfigured, "Error loading pysqlite2 module: %s" % e
DatabaseError = Database.DatabaseError
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates
-~----------~----~----~----~------~----~------~--~---