From b8c368feb254b225edacb50de13c9037cfd1ef9c Mon Sep 17 00:00:00 2001 From: Ian Kelly Date: Wed, 8 Dec 2010 07:56:43 +0000 Subject: [PATCH] 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 --- django/db/backends/oracle/base.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py index cf8d920989..e10706e683 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)