~ubuntu-branches/ubuntu/quantal/python-django/quantal

« back to all changes in this revision

Viewing changes to django/contrib/gis/gdal/prototypes/errcheck.py

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb
  • Date: 2009-07-29 11:26:28 UTC
  • mfrom: (1.1.8 upstream) (4.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20090729112628-pg09ino8sz0sj21t
Tags: 1.1-1
* New upstream release.
* Merge from experimental:
  - Ship FastCGI initscript and /etc/default file in python-django's examples
    directory (Closes: #538863)
  - Drop "05_10539-sphinx06-compatibility.diff"; it has been applied
    upstream.
  - Bump Standards-Version to 3.8.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
    "Checks a function that returns a geometry."
72
72
    # OGR_G_Clone may return an integer, even though the
73
73
    # restype is set to c_void_p
74
 
    if isinstance(result, int):
 
74
    if isinstance(result, (int, long)):
75
75
        result = c_void_p(result)
76
76
    if not result: 
77
77
        raise OGRException('Invalid geometry pointer returned from "%s".' % func.__name__)
85
85
 
86
86
### Spatial Reference error-checking routines ###
87
87
def check_srs(result, func, cargs):
88
 
    if isinstance(result, int):
 
88
    if isinstance(result, (int, long)):
89
89
        result = c_void_p(result)
90
90
    if not result:
91
91
        raise SRSException('Invalid spatial reference pointer returned from "%s".' % func.__name__)