Browse files

Need to catch `ImproperlyConfigured` to be freed from the schackles o…

…f `DJANGO_SETTINGS_MODULE`.
  • Loading branch information...
1 parent ab8c970 commit 950e6183c60d368c62f627eaed54961be0a207d8 @jbronn jbronn committed Oct 5, 2012
Showing with 6 additions and 4 deletions.
  1. +3 −2 django/contrib/gis/gdal/libgdal.py
  2. +3 −2 django/contrib/gis/geos/libgeos.py
View
5 django/contrib/gis/gdal/libgdal.py
@@ -7,15 +7,16 @@
from ctypes.util import find_library
from django.contrib.gis.gdal.error import OGRException
-
+from django.core.exceptions import ImproperlyConfigured
logger = logging.getLogger('django.contrib.gis')
# Custom library path set?
try:
from django.conf import settings
lib_path = settings.GDAL_LIBRARY_PATH
-except (AttributeError, EnvironmentError, ImportError):
+except (AttributeError, EnvironmentError,
+ ImportError, ImproperlyConfigured):
lib_path = None
if lib_path:
View
5 django/contrib/gis/geos/libgeos.py
@@ -13,15 +13,16 @@
from ctypes.util import find_library
from django.contrib.gis.geos.error import GEOSException
-
+from django.core.exceptions import ImproperlyConfigured
logger = logging.getLogger('django.contrib.gis')
# Custom library path set?
try:
from django.conf import settings
lib_path = settings.GEOS_LIBRARY_PATH
-except (AttributeError, EnvironmentError, ImportError):
+except (AttributeError, EnvironmentError,
+ ImportError, ImproperlyConfigured):
lib_path = None
# Setting the appropriate names for the GEOS-C library.

0 comments on commit 950e618

Please sign in to comment.