Skip to content

Commit d5a1a1e

Browse files
authored
Merge pull request #140 from blueyed/handle-non-lnum
parse_gcov_file: handle empty/no lnum
2 parents 6ed9f8f + 21ef683 commit d5a1a1e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cpp_coveralls/coverage.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,12 @@ def parse_gcov_file(args, fobj, filename):
249249
report_fields = line.decode('utf-8', 'replace').split(':', 2)
250250
if len(report_fields) == 1:
251251
continue
252+
line_num = report_fields[1].strip()
253+
if line_num == '':
254+
continue
252255

253256
cov_num = report_fields[0].strip()
254-
line_num = int(report_fields[1].strip())
257+
line_num = int(line_num)
255258
text = report_fields[2]
256259
if line_num == 0:
257260
continue

0 commit comments

Comments
 (0)