mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Fixed #11609 -- The check_pointer
error checking routine and GDALBase._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
This commit is contained in:
parent
f58fb383fb
commit
1d581cda67
@ -24,7 +24,7 @@ class GDALBase(object):
|
||||
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
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user