web/lib/django/contrib/gis/gdal/base.py
changeset 29 cc9b7e14412b
parent 0 0d40e90630ef
equal deleted inserted replaced
28:b758351d191f 29:cc9b7e14412b
    22         else: raise GDALException('GDAL %s pointer no longer valid.' % self.__class__.__name__)
    22         else: raise GDALException('GDAL %s pointer no longer valid.' % self.__class__.__name__)
    23 
    23 
    24     def _set_ptr(self, ptr):
    24     def _set_ptr(self, ptr):
    25         # Only allow the pointer to be set with pointers of the
    25         # Only allow the pointer to be set with pointers of the
    26         # compatible type or None (NULL).
    26         # compatible type or None (NULL).
    27         if isinstance(ptr, int):
    27         if isinstance(ptr, (int, long)):
    28             self._ptr = self.ptr_type(ptr)
    28             self._ptr = self.ptr_type(ptr)
    29         elif isinstance(ptr, (self.ptr_type, NoneType)):
    29         elif isinstance(ptr, (self.ptr_type, NoneType)):
    30             self._ptr = ptr
    30             self._ptr = ptr
    31         else:
    31         else:
    32             raise TypeError('Incompatible pointer type')
    32             raise TypeError('Incompatible pointer type')