Skip to content
Snippets Groups Projects
Commit 7f370c5d authored by Kien Le's avatar Kien Le
Browse files

Close log file when iterator over it is exhausted

parent b4fe6d8d
No related merge requests found
...@@ -111,6 +111,7 @@ class LogFile: ...@@ -111,6 +111,7 @@ class LogFile:
def __next__(self) -> List[str]: def __next__(self) -> List[str]:
line = self.file.readline() line = self.file.readline()
if line == '': if line == '':
self.file.close()
raise StopIteration raise StopIteration
while line == '\n': while line == '\n':
line = self.file.readline() line = self.file.readline()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment