Commit e298c301 authored by Jeremy Hylton's avatar Jeremy Hylton

if the GzipFile constructor fails, the __del__ method is still

called.  catch the resulting AttributeError and exit cleanly.
parent c554505c
......@@ -253,9 +253,13 @@ class GzipFile:
self.myfileobj = None
def __del__(self):
if (self.myfileobj is not None or
self.fileobj is not None):
self.close()
try:
if (self.myfileobj is None and
self.fileobj is None):
return
except AttributeError:
return
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