[tor-commits] [tor/master] practracker: handle empty files.
dgoulet at torproject.org
dgoulet at torproject.org
Wed Sep 11 13:04:16 UTC 2019
commit 03040903e677172ce46319b83f9d00bafb33fad7
Author: Nick Mathewson <nickm at torproject.org>
Date: Mon Sep 2 15:33:59 2019 -0400
practracker: handle empty files.
Previously practracker would fail on a file with no lines.
---
scripts/maint/practracker/metrics.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/maint/practracker/metrics.py b/scripts/maint/practracker/metrics.py
index 9f69b2ac1..4c62bc242 100644
--- a/scripts/maint/practracker/metrics.py
+++ b/scripts/maint/practracker/metrics.py
@@ -8,6 +8,7 @@ import re
def get_file_len(f):
"""Get file length of file"""
+ i = -1
for i, l in enumerate(f):
pass
return i + 1
More information about the tor-commits
mailing list