mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
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.
This commit is contained in:
parent
32616cf8ec
commit
30d4896511
2 changed files with 4 additions and 4 deletions
|
@ -31,10 +31,7 @@ class UnlinkingLogReader(hotshot.log.LogReader):
|
|||
try:
|
||||
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.
|
||||
self.close()
|
||||
os.unlink(self.__logfn)
|
||||
raise
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue