diff options
| author | Tim Graham <timograham@gmail.com> | 2017-05-08 09:42:06 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-05-08 11:07:00 -0400 |
| commit | c2975910a5bc2729c2de01eb5b84777fa59551e1 (patch) | |
| tree | 4f22b455f2840ed691cb06775c577f22cc1f61c6 /django | |
| parent | a404f75f92971634c76330f3742261d33ccecca1 (diff) | |
Fixed #28178 -- Changed contrib.gis to raise ImproperlyConfigured if gdal isn't installed.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/gis/gdal/libgdal.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/django/contrib/gis/gdal/libgdal.py b/django/contrib/gis/gdal/libgdal.py index ac0b9bbd44..056efaf01d 100644 --- a/django/contrib/gis/gdal/libgdal.py +++ b/django/contrib/gis/gdal/libgdal.py @@ -26,7 +26,7 @@ elif os.name == 'posix': # *NIX library names. lib_names = ['gdal', 'GDAL', 'gdal2.1.0', 'gdal2.0.0', 'gdal1.11.0', 'gdal1.10.0', 'gdal1.9.0'] else: - raise GDALException('Unsupported OS "%s"' % os.name) + raise ImproperlyConfigured('GDAL is unsupported on OS "%s".' % os.name) # Using the ctypes `find_library` utility to find the # path to the GDAL library from the list of library names. @@ -37,9 +37,10 @@ if lib_names: break if lib_path is None: - raise GDALException( - 'Could not find the GDAL library (tried "%s"). Try setting ' - 'GDAL_LIBRARY_PATH in your settings.' % '", "'.join(lib_names) + raise ImproperlyConfigured( + 'Could not find the GDAL library (tried "%s"). Is GDAL installed? ' + 'If it is, try setting GDAL_LIBRARY_PATH in your settings.' + % '", "'.join(lib_names) ) # This loads the GDAL/OGR C library |
