practracker: handle empty files.

Previously practracker would fail on a file with no lines.
This commit is contained in:
Nick Mathewson 2019-09-02 15:33:59 -04:00
parent 3a2964577e
commit 03040903e6

View File

@ -8,6 +8,7 @@ import re
def get_file_len(f): def get_file_len(f):
"""Get file length of file""" """Get file length of file"""
i = -1
for i, l in enumerate(f): for i, l in enumerate(f):
pass pass
return i + 1 return i + 1