Skip to content

Commit

Permalink
Fixed #11609 -- The check_pointer error checking routine and `GDALB…
Browse files Browse the repository at this point in the history
…ase._set_ptr` are now able to handle the long pointer addresses used by some x86_64 platforms. Thanks, rmkemker, for the bug report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12006 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jbronn committed Dec 27, 2009
1 parent f58fb38 commit 1d581cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion django/contrib/gis/gdal/base.py
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions django/contrib/gis/gdal/prototypes/errcheck.py
Expand Up @@ -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
else:
Expand Down

0 comments on commit 1d581cd

Please sign in to comment.