Kevin Jacobs <jacobs@darwin.cwru.edu>:

The posixfile __del__ method attempts to close the file (_file_) it
contains. However, if the open() method fails, then _file_ is never
assigned.

This closes SourceForge bug #113850.
This commit is contained in:
Fred Drake 2000-09-09 06:26:40 +00:00
parent 8f422461b4
commit 16c4aa441b

View file

@ -68,7 +68,8 @@ def __repr__(self):
hex(id(self))[2:])
def __del__(self):
self._file_.close()
if hasattr(self, "_file_"):
self._file_.close()
#
# Initialization routines