From d40a38b3359b966cac9a6df81d27000572e2deaa Mon Sep 17 00:00:00 2001
From: Sergey Fedoseev <fedoseev.sergey@gmail.com>
Date: Sat, 12 Dec 2015 15:26:17 +0500
Subject: [PATCH] Unwrapped gdal.Envelope import from try-except as fail of
 `import ctypes` is not expected.

---
 django/contrib/gis/gdal/__init__.py | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/django/contrib/gis/gdal/__init__.py b/django/contrib/gis/gdal/__init__.py
index 1dad9aa9ab..4d8688c6ac 100644
--- a/django/contrib/gis/gdal/__init__.py
+++ b/django/contrib/gis/gdal/__init__.py
@@ -31,13 +31,14 @@
  to a non-existent file location (e.g., `GDAL_LIBRARY_PATH='/null/path'`;
  setting to None/False/'' will not work as a string must be given).
 """
+from django.contrib.gis.gdal.envelope import Envelope
 from django.contrib.gis.gdal.error import (  # NOQA
     GDALException, OGRException, OGRIndexError, SRSException, check_err,
 )
 from django.contrib.gis.gdal.geomtype import OGRGeomType  # NOQA
 
 __all__ = [
-    'check_err', 'GDALException', 'OGRException', 'OGRIndexError',
+    'check_err', 'Envelope', 'GDALException', 'OGRException', 'OGRIndexError',
     'SRSException', 'OGRGeomType', 'HAS_GDAL',
 ]
 
@@ -59,10 +60,3 @@ try:
     ]
 except GDALException:
     HAS_GDAL = False
-
-try:
-    from django.contrib.gis.gdal.envelope import Envelope
-    __all__ += ['Envelope']
-except ImportError:
-    # No ctypes, but don't raise an exception.
-    pass