diff options
| author | Justin Bronn <jbronn@gmail.com> | 2010-01-27 03:01:13 +0000 |
|---|---|---|
| committer | Justin Bronn <jbronn@gmail.com> | 2010-01-27 03:01:13 +0000 |
| commit | f9f04a49e85641a8cdd19ef57ed63e5be31cab0f (patch) | |
| tree | 0d6db5cfc419368b905d8ff7dd9ba0401f471953 | |
| parent | 474ce51ffd9e7f0963d666bdb429f00b04cdaee3 (diff) | |
Got rid of Python 2.3 compatibility global, and thus `OGRGeomType` import wrapping with try/except no longer necessary.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12301 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/gis/gdal/__init__.py | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/django/contrib/gis/gdal/__init__.py b/django/contrib/gis/gdal/__init__.py index b318850b28..5ef8a85927 100644 --- a/django/contrib/gis/gdal/__init__.py +++ b/django/contrib/gis/gdal/__init__.py @@ -13,7 +13,7 @@ Envelope: A ctypes structure for bounding boxes (GDAL library not required). - OGRGeometry: Layer for accessing OGR Geometry objects. + OGRGeometry: Object for accessing OGR Geometry functionality. OGRGeomType: A class for representing the different OGR Geometry types (GDAL library not required). @@ -31,8 +31,6 @@ to a non-existant file location (e.g., `GDAL_LIBRARY_PATH='/null/path'`; setting to None/False/'' will not work as a string must be given). """ -import sys - # Attempting to import objects that depend on the GDAL library. The # HAS_GDAL flag will be set to True if the library is present on # the system. @@ -46,14 +44,11 @@ try: except: HAS_GDAL, GEOJSON = False, False -# The envelope, error, and geomtype modules do not actually require the -# GDAL library, but still nead at least Python 2.4 and ctypes. -PYTHON23 = sys.version_info[0] == 2 and sys.version_info[1] == 3 -if not PYTHON23: - try: - from django.contrib.gis.gdal.envelope import Envelope - from django.contrib.gis.gdal.error import check_err, OGRException, OGRIndexError, SRSException - from django.contrib.gis.gdal.geomtype import OGRGeomType - except ImportError: - # No ctypes, but don't raise an exception. - pass +try: + from django.contrib.gis.gdal.envelope import Envelope +except ImportError: + # No ctypes, but don't raise an exception. + pass + +from django.contrib.gis.gdal.error import check_err, OGRException, OGRIndexError, SRSException +from django.contrib.gis.gdal.geomtype import OGRGeomType |
