Skip to content
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
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,7 +7,7 @@
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')
@@ -15,7 +15,8 @@
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,7 +13,7 @@
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')
@@ -21,7 +21,8 @@
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.
Something went wrong with that request. Please try again.