Kaydet (Commit) 950e6183 authored tarafından Justin Bronn's avatar Justin Bronn

Need to catch `ImproperlyConfigured` to be freed from the schackles of `DJANGO_SETTINGS_MODULE`.

üst ab8c9703
......@@ -7,7 +7,7 @@ from ctypes import c_char_p, c_int, CDLL, CFUNCTYPE
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 @@ logger = logging.getLogger('django.contrib.gis')
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:
......
......@@ -13,7 +13,7 @@ from ctypes import c_char_p, Structure, CDLL, CFUNCTYPE, POINTER
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 @@ logger = logging.getLogger('django.contrib.gis')
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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment