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,8 +253,12 @@ class GzipFile:
self.myfileobj = None
def __del__(self):
if (self.myfileobj is not None or
self.fileobj is not None):
try:
if (self.myfileobj is None and
self.fileobj is None):
return
except AttributeError:
return
self.close()
def flush(self):
......
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