summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Bronn <jbronn@gmail.com>2009-01-03 01:37:51 +0000
committerJustin Bronn <jbronn@gmail.com>2009-01-03 01:37:51 +0000
commit3cd1e80ae4c4ed1fdd6728bd4fb501ba6219fafa (patch)
tree99fe34b90b3850106f242cdc891a003bc609aa16
parenta754165a919ad12cc62723d81f4df6e046ad18cb (diff)
Fixed `check_geom` and `check_srs` to accept larger sized pointer addresses as returned by some platforms (including OpenBSD 4.4 and Fedora 8).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9693 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/gis/gdal/prototypes/errcheck.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/contrib/gis/gdal/prototypes/errcheck.py b/django/contrib/gis/gdal/prototypes/errcheck.py
index c66be9adfb..3a0e0d6170 100644
--- a/django/contrib/gis/gdal/prototypes/errcheck.py
+++ b/django/contrib/gis/gdal/prototypes/errcheck.py
@@ -71,7 +71,7 @@ def check_geom(result, func, cargs):
"Checks a function that returns a geometry."
# OGR_G_Clone may return an integer, even though the
# restype is set to c_void_p
- if isinstance(result, int):
+ if isinstance(result, (int, long)):
result = c_void_p(result)
if not result:
raise OGRException('Invalid geometry pointer returned from "%s".' % func.__name__)
@@ -85,7 +85,7 @@ def check_geom_offset(result, func, cargs, offset=-1):
### Spatial Reference error-checking routines ###
def check_srs(result, func, cargs):
- if isinstance(result, int):
+ if isinstance(result, (int, long)):
result = c_void_p(result)
if not result:
raise SRSException('Invalid spatial reference pointer returned from "%s".' % func.__name__)