mirror of
https://github.com/django/django.git
synced 2025-09-19 08:49:57 +00:00
Fixed #25938 -- Factored out CPointerBase base class for GEOSBase/GDALBase.
This commit is contained in:
parent
4884472447
commit
b01ceae843
16 changed files with 131 additions and 194 deletions
|
@ -57,6 +57,8 @@ class GDALRaster(GDALBase):
|
|||
"""
|
||||
Wraps a raster GDAL Data Source object.
|
||||
"""
|
||||
destructor = capi.close_ds
|
||||
|
||||
def __init__(self, ds_input, write=False):
|
||||
self._write = 1 if write else 0
|
||||
Driver.ensure_registered()
|
||||
|
@ -143,12 +145,6 @@ class GDALRaster(GDALBase):
|
|||
else:
|
||||
raise GDALException('Invalid data source input type: "{}".'.format(type(ds_input)))
|
||||
|
||||
def __del__(self):
|
||||
try:
|
||||
capi.close_ds(self._ptr)
|
||||
except (AttributeError, TypeError):
|
||||
pass # Some part might already have been garbage collected
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue