Issue #23865: close() methods in multiple modules now are idempotent and more

robust at shutdown. If needs to release multiple resources, they are released
even if errors are occured.
This commit is contained in:
Serhiy Storchaka 2015-04-10 13:24:41 +03:00
parent 842f00e725
commit 7e7a3dba5f
27 changed files with 299 additions and 197 deletions

View file

@ -356,7 +356,10 @@ class Aifc_read:
self._soundpos = 0
def close(self):
self._file.close()
file = self._file
if file is not None:
self._file = None
file.close()
def tell(self):
return self._soundpos