Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…f `DJANGO_SETTINGS_MODULE`.
  • Loading branch information...
commit 950e6183c60d368c62f627eaed54961be0a207d8 1 parent ab8c970
Justin Bronn authored October 05, 2012
5  django/contrib/gis/gdal/libgdal.py
@@ -7,7 +7,7 @@
7 7
 from ctypes.util import find_library
8 8
 
9 9
 from django.contrib.gis.gdal.error import OGRException
10  
-
  10
+from django.core.exceptions import ImproperlyConfigured
11 11
 
12 12
 logger = logging.getLogger('django.contrib.gis')
13 13
 
@@ -15,7 +15,8 @@
15 15
 try:
16 16
     from django.conf import settings
17 17
     lib_path = settings.GDAL_LIBRARY_PATH
18  
-except (AttributeError, EnvironmentError, ImportError):
  18
+except (AttributeError, EnvironmentError,
  19
+        ImportError, ImproperlyConfigured):
19 20
     lib_path = None
20 21
 
21 22
 if lib_path:
5  django/contrib/gis/geos/libgeos.py
@@ -13,7 +13,7 @@
13 13
 from ctypes.util import find_library
14 14
 
15 15
 from django.contrib.gis.geos.error import GEOSException
16  
-
  16
+from django.core.exceptions import ImproperlyConfigured
17 17
 
18 18
 logger = logging.getLogger('django.contrib.gis')
19 19
 
@@ -21,7 +21,8 @@
21 21
 try:
22 22
     from django.conf import settings
23 23
     lib_path = settings.GEOS_LIBRARY_PATH
24  
-except (AttributeError, EnvironmentError, ImportError):
  24
+except (AttributeError, EnvironmentError,
  25
+        ImportError, ImproperlyConfigured):
25 26
     lib_path = None
26 27
 
27 28
 # Setting the appropriate names for the GEOS-C library.

0 notes on commit 950e618

Please sign in to comment.
Something went wrong with that request. Please try again.