Commit db728b68 authored by Tim Peters's avatar Tim Peters

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.
parent eb95f672
......@@ -51,6 +51,9 @@ class LogReader:
self._append = self._stack.append
self._pop = self._stack.pop
def close(self):
self._reader.close()
def addinfo(self, key, value):
"""This method is called for each additional ADD_INFO record.
......
......@@ -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
......
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