Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Got rid of Python 2.3 compatibility global, and thus `OGRGeomType` im…

…port wrapping with try/except no longer necessary.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12301 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f9f04a49e85641a8cdd19ef57ed63e5be31cab0f 1 parent 474ce51
@jbronn jbronn authored
Showing with 9 additions and 14 deletions.
  1. +9 −14 django/contrib/gis/gdal/__init__.py
View
23 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 @@
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
Please sign in to comment.
Something went wrong with that request. Please try again.