diff options
| author | Justin Bronn <jbronn@gmail.com> | 2009-12-27 18:13:20 +0000 |
|---|---|---|
| committer | Justin Bronn <jbronn@gmail.com> | 2009-12-27 18:13:20 +0000 |
| commit | f1fe7c00e2c5496fd6998965385834f720bb35c2 (patch) | |
| tree | 687eca63a1a9055e7f04b750979659eb7dd9f066 | |
| parent | 90f7dfb461df5081545aadd5cbe8d3a70c5e8a2e (diff) | |
[1.1.X] 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.
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
| -rw-r--r-- | django/contrib/gis/gdal/base.py | 2 | ||||
| -rw-r--r-- | django/contrib/gis/gdal/prototypes/errcheck.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/django/contrib/gis/gdal/base.py b/django/contrib/gis/gdal/base.py index e19b748e6f..f9455c783a 100644 --- a/django/contrib/gis/gdal/base.py +++ b/django/contrib/gis/gdal/base.py @@ -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 diff --git a/django/contrib/gis/gdal/prototypes/errcheck.py b/django/contrib/gis/gdal/prototypes/errcheck.py index 3a0e0d6170..91858ea572 100644 --- a/django/contrib/gis/gdal/prototypes/errcheck.py +++ b/django/contrib/gis/gdal/prototypes/errcheck.py @@ -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: |
