equal
deleted
inserted
replaced
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') |