diff options
| author | Ian Kelly <ian.g.kelly@gmail.com> | 2010-12-08 08:00:50 +0000 |
|---|---|---|
| committer | Ian Kelly <ian.g.kelly@gmail.com> | 2010-12-08 08:00:50 +0000 |
| commit | d0056051a508610ba421bfa68c2069da2199242c (patch) | |
| tree | 253d091f5bacf3d5bafd1702b4f63cc6b12ba131 | |
| parent | 1c81377af583029d014a85db62c7e78d8b924e4e (diff) | |
[1.2.X] Replaced an ImportError with ImproperlyConfigured in the Oracle backend. Backport of r14855 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14856 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/db/backends/oracle/base.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py index d6c679a284..1387e602ed 100644 --- a/django/db/backends/oracle/base.py +++ b/django/db/backends/oracle/base.py @@ -18,8 +18,11 @@ def _setup_environment(environ): if platform.system().upper().startswith('CYGWIN'): try: import ctypes - except ImportError: - raise ImportError("ctypes not found. The Oracle backend requires ctypes to operate correctly under Cygwin.") + except ImportError, e: + from django.core.exceptions import ImproperlyConfigured + raise ImproperlyConfigured("Error loading ctypes: %s; " + "the Oracle backend requires ctypes to " + "operate correctly under Cygwin." % e) kernel32 = ctypes.CDLL('kernel32') for name, value in environ: kernel32.SetEnvironmentVariableA(name, value) |
