From 610a56fb7ef43614be8752c4561c6c0f118db021 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 14 May 2023 14:58:06 -0400 Subject: fix: lcov report indexeerror for some Jinja2 files. #1553 --- coverage/lcovreport.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'coverage') diff --git a/coverage/lcovreport.py b/coverage/lcovreport.py index 8e3a5768..3da164d5 100644 --- a/coverage/lcovreport.py +++ b/coverage/lcovreport.py @@ -74,6 +74,8 @@ class LcovReporter: # characters of the encoding ("==") are removed from the hash to # allow genhtml to run on the resulting lcov file. if source_lines: + if covered-1 >= len(source_lines): + break line = source_lines[covered-1] else: line = "" -- cgit v1.2.1