mirror of
https://github.com/django/django.git
synced 2025-09-20 01:10:35 +00:00
Fixed #25657 -- Ignored exceptions when destroying geometry objects
Due to randomness of garbage collection with geometry objects, it's easier to simply ignore AttributeError/TypeError generally raised when parts of objects are already garbage-collected. Thanks Sergey Fedoseev and Tim Graham for reviewing the patch.
This commit is contained in:
parent
ec708803f7
commit
cd40d9e721
8 changed files with 27 additions and 9 deletions
|
@ -131,8 +131,10 @@ class GDALRaster(GDALBase):
|
|||
raise GDALException('Invalid data source input type: "{}".'.format(type(ds_input)))
|
||||
|
||||
def __del__(self):
|
||||
if self._ptr and capi:
|
||||
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