Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12007 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f1fe7c00e2c5496fd6998965385834f720bb35c2 1 parent 90f7dfb
Justin Bronn authored December 27, 2009
2  django/contrib/gis/gdal/base.py
@@ -24,7 +24,7 @@ def _get_ptr(self):
24 24
     def _set_ptr(self, ptr):
25 25
         # Only allow the pointer to be set with pointers of the
26 26
         # compatible type or None (NULL).
27  
-        if isinstance(ptr, int):
  27
+        if isinstance(ptr, (int, long)):
28 28
             self._ptr = self.ptr_type(ptr)
29 29
         elif isinstance(ptr, (self.ptr_type, NoneType)):
30 30
             self._ptr = ptr
2  django/contrib/gis/gdal/prototypes/errcheck.py
@@ -109,6 +109,8 @@ def check_errcode(result, func, cargs):
109 109
 
110 110
 def check_pointer(result, func, cargs):
111 111
     "Makes sure the result pointer is valid."
  112
+    if isinstance(result, (int, long)):
  113
+        result = c_void_p(result)
112 114
     if bool(result): 
113 115
         return result
114 116
     else: 

0 notes on commit f1fe7c0

Please sign in to comment.
Something went wrong with that request. Please try again.