Kaydet (Commit) 916fcc3b authored tarafından Andrew M. Kuchling's avatar Andrew M. Kuchling

Added __del__ method to GzipFile class that will flush and close the

object, if required.
üst 68921dfa
......@@ -251,6 +251,11 @@ class GzipFile:
self.myfileobj.close()
self.myfileobj = None
def __del__(self):
if (self.myfileobj is not None or
self.fileobj is not None):
self.close()
def flush(self):
self.fileobj.flush()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment