mirror of
https://github.com/django/django.git
synced 2025-07-19 17:19:12 +00:00
[1.0.X] Fixed check_geom
and check_srs
to accept larger sized pointer addresses as returned by some platforms (including OpenBSD 4.4 and Fedora 8).
Backport of r9693 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9694 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
1f2e21ba07
commit
94b83db499
@ -71,7 +71,7 @@ def check_geom(result, func, cargs):
|
|||||||
"Checks a function that returns a geometry."
|
"Checks a function that returns a geometry."
|
||||||
# OGR_G_Clone may return an integer, even though the
|
# OGR_G_Clone may return an integer, even though the
|
||||||
# restype is set to c_void_p
|
# restype is set to c_void_p
|
||||||
if isinstance(result, int):
|
if isinstance(result, (int, long)):
|
||||||
result = c_void_p(result)
|
result = c_void_p(result)
|
||||||
if not result:
|
if not result:
|
||||||
raise OGRException('Invalid geometry pointer returned from "%s".' % func.__name__)
|
raise OGRException('Invalid geometry pointer returned from "%s".' % func.__name__)
|
||||||
@ -85,7 +85,7 @@ def check_geom_offset(result, func, cargs, offset=-1):
|
|||||||
|
|
||||||
### Spatial Reference error-checking routines ###
|
### Spatial Reference error-checking routines ###
|
||||||
def check_srs(result, func, cargs):
|
def check_srs(result, func, cargs):
|
||||||
if isinstance(result, int):
|
if isinstance(result, (int, long)):
|
||||||
result = c_void_p(result)
|
result = c_void_p(result)
|
||||||
if not result:
|
if not result:
|
||||||
raise SRSException('Invalid spatial reference pointer returned from "%s".' % func.__name__)
|
raise SRSException('Invalid spatial reference pointer returned from "%s".' % func.__name__)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user