[Python-checkins] CVS: python/dist/src/Lib posixfile.py,1.14,1.15
Fred L. Drake
python-dev@python.org
Fri, 8 Sep 2000 23:26:42 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv25854
Modified Files:
posixfile.py
Log Message:
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.
Index: posixfile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/posixfile.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** posixfile.py 2000/08/29 14:57:27 1.14
--- posixfile.py 2000/09/09 06:26:40 1.15
***************
*** 69,73 ****
def __del__(self):
! self._file_.close()
#
--- 69,74 ----
def __del__(self):
! if hasattr(self, "_file_"):
! self._file_.close()
#