소스 검색

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