mirror of
https://github.com/django/django.git
synced 2024-12-25 10:35:48 +00:00
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
This commit is contained in:
parent
3863c906ce
commit
b8c368feb2
@ -18,8 +18,11 @@ def _setup_environment(environ):
|
|||||||
if platform.system().upper().startswith('CYGWIN'):
|
if platform.system().upper().startswith('CYGWIN'):
|
||||||
try:
|
try:
|
||||||
import ctypes
|
import ctypes
|
||||||
except ImportError:
|
except ImportError, e:
|
||||||
raise ImportError("ctypes not found. The Oracle backend requires ctypes to operate correctly under Cygwin.")
|
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')
|
kernel32 = ctypes.CDLL('kernel32')
|
||||||
for name, value in environ:
|
for name, value in environ:
|
||||||
kernel32.SetEnvironmentVariableA(name, value)
|
kernel32.SetEnvironmentVariableA(name, value)
|
||||||
|
Loading…
Reference in New Issue
Block a user