[Python-checkins] python/dist/src/Lib/test test_hotshot.py,1.8,1.9

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Thu, 18 Jul 2002 07:54:30 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv17095/python/Lib/test

Modified Files:
	test_hotshot.py 
Log Message:
Gave hotshot.LogReader a close() method, to allow users to close the
file object that LogReader opens.  Used it then in test_hotshot; the
test passes again on Windows.  Thank Guido for the analysis.


Index: test_hotshot.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_hotshot.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** test_hotshot.py	17 Jul 2002 23:52:58 -0000	1.8
--- test_hotshot.py	18 Jul 2002 14:54:28 -0000	1.9
***************
*** 32,39 ****
              return hotshot.log.LogReader.next(self)
          except (IndexError, StopIteration):
!             # XXX This fails on Windows because the named file is still
!             # XXX open.  Offhand I couldn't find an appropriate way to close
!             # XXX the file object, or even where the heck it is.  LogReader
!             # XXX in particular doesn't have a close() method.
              os.unlink(self.__logfn)
              raise
--- 32,36 ----
              return hotshot.log.LogReader.next(self)
          except (IndexError, StopIteration):
!             self.close()
              os.unlink(self.__logfn)
              raise