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

Fix bug with some log files

Fix problem with log files that have more than one blank lines at the
end.
parent f9d73211
No related branches found
No related tags found
1 merge request!191Read log files generated by users
......@@ -122,6 +122,12 @@ class LogFile:
line = self.file.readline()
if line == '':
break
# If there are more than one blank lines at the end of a log file, the
# last packet will be empty. This causes problem if the log file came
# from rt2ms or SOHStationViewer.
if not packet:
self.file.close()
raise StopIteration
return packet
def __del__(self):
......
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