Skip to content

Commit

Permalink
[1.2.X] Replaced an ImportError with ImproperlyConfigured in the Orac…
Browse files Browse the repository at this point in the history
…le 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
  • Loading branch information
nightflyerkilo committed Dec 8, 2010
1 parent 1c81377 commit d005605
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions django/db/backends/oracle/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d005605

Please sign in to comment.