瀏覽代碼

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):
 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