Commit b8c368fe authored by Ian Kelly's avatar Ian Kelly
Browse files

Replaced an ImportError with ImproperlyConfigured in the Oracle backend.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14855 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 3863c906
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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)