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

@ -85,8 +85,10 @@ class Chunk:
def close(self):
if not self.closed:
self.skip()
self.closed = True
try:
self.skip()
finally:
self.closed = True
def isatty(self):
if self.closed: