Commit 16c4aa44 authored by Fred Drake's avatar Fred Drake

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.
parent 8f422461
......@@ -68,7 +68,8 @@ class _posixfile_:
hex(id(self))[2:])
def __del__(self):
self._file_.close()
if hasattr(self, "_file_"):
self._file_.close()
#
# Initialization routines
......
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