Преглед изворни кода

practracker: handle empty files.

Previously practracker would fail on a file with no lines.
Nick Mathewson пре 4 година
родитељ
комит
03040903e6
1 измењених фајлова са 1 додато и 0 уклоњено
  1. 1 0
      scripts/maint/practracker/metrics.py

+ 1 - 0
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