1
0
mirror of https://github.com/django/django.git synced 2025-02-23 16:16:22 +00:00

Unwrapped gdal.Envelope import from try-except as fail of import ctypes is not expected.

This commit is contained in:
Sergey Fedoseev 2015-12-12 15:26:17 +05:00 committed by Tim Graham
parent 10427646b8
commit d40a38b335

View File

@ -31,13 +31,14 @@
to a non-existent file location (e.g., `GDAL_LIBRARY_PATH='/null/path'`; 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). 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 from django.contrib.gis.gdal.error import ( # NOQA
GDALException, OGRException, OGRIndexError, SRSException, check_err, GDALException, OGRException, OGRIndexError, SRSException, check_err,
) )
from django.contrib.gis.gdal.geomtype import OGRGeomType # NOQA from django.contrib.gis.gdal.geomtype import OGRGeomType # NOQA
__all__ = [ __all__ = [
'check_err', 'GDALException', 'OGRException', 'OGRIndexError', 'check_err', 'Envelope', 'GDALException', 'OGRException', 'OGRIndexError',
'SRSException', 'OGRGeomType', 'HAS_GDAL', 'SRSException', 'OGRGeomType', 'HAS_GDAL',
] ]
@ -59,10 +60,3 @@ try:
] ]
except GDALException: except GDALException:
HAS_GDAL = False 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