From 6eda8d784a128309a67540fb0a62373667958daa Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Mon, 24 Sep 2012 16:03:12 +0200 Subject: [PATCH] Enlarged exception catching when testing for GDAL presence Other import errors than ImportError can happen during import of GDAL files (e.g. OGRException). Some further auditing may be needed if we want to restrict the catched exceptions at a later stage. Thanks Ramiro Morales for raising the issue. --- django/contrib/gis/gdal/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/contrib/gis/gdal/__init__.py b/django/contrib/gis/gdal/__init__.py index f477f05982..de41df90ff 100644 --- a/django/contrib/gis/gdal/__init__.py +++ b/django/contrib/gis/gdal/__init__.py @@ -41,7 +41,7 @@ try: from django.contrib.gis.gdal.srs import SpatialReference, CoordTransform from django.contrib.gis.gdal.geometries import OGRGeometry HAS_GDAL = True -except ImportError: +except Exception: HAS_GDAL = False try: