diff --git a/django/contrib/gis/geoip/__init__.py b/django/contrib/gis/geoip/__init__.py index 572c778e81..edb395f508 100644 --- a/django/contrib/gis/geoip/__init__.py +++ b/django/contrib/gis/geoip/__init__.py @@ -14,5 +14,5 @@ try: from .base import GeoIP, GeoIPException HAS_GEOIP = True -except ImportError: +except RuntimeError: # libgeoip.py raises a RuntimeError if no GeoIP library is found HAS_GEOIP = False