Browse files

[1.1.X] Fixed #11609 -- The `check_pointer` error checking routine an…

…d `GDALBase._set_ptr` are now able to handle the long pointer addresses used by some x86_64 platforms. Thanks, rmkemker, for the bug report.

Backport of r12006 from trunk.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 90f7dfb commit f1fe7c00e2c5496fd6998965385834f720bb35c2 @jbronn jbronn committed Dec 27, 2009
Showing with 3 additions and 1 deletion.
  1. +1 −1 django/contrib/gis/gdal/
  2. +2 −0 django/contrib/gis/gdal/prototypes/
@@ -24,7 +24,7 @@ def _get_ptr(self):
def _set_ptr(self, ptr):
# Only allow the pointer to be set with pointers of the
# compatible type or None (NULL).
- if isinstance(ptr, int):
+ if isinstance(ptr, (int, long)):
self._ptr = self.ptr_type(ptr)
elif isinstance(ptr, (self.ptr_type, NoneType)):
self._ptr = ptr
@@ -109,6 +109,8 @@ def check_errcode(result, func, cargs):
def check_pointer(result, func, cargs):
"Makes sure the result pointer is valid."
+ if isinstance(result, (int, long)):
+ result = c_void_p(result)
if bool(result):
return result

0 comments on commit f1fe7c0

Please sign in to comment.