We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bfb0c70 commit 468aa22Copy full SHA for 468aa22
coverage/parser.py
@@ -109,12 +109,11 @@ def lines_matching(self, regex: str) -> set[TLineNo]:
109
Handles multiline regex patterns.
110
111
"""
112
- regex_c = re.compile(regex, re.MULTILINE)
113
matches: set[TLineNo] = set()
114
115
last_start = 0
116
last_start_line = 0
117
- for match in regex_c.finditer(self.text):
+ for match in re.finditer(regex, self.text, flags=re.MULTILINE):
118
start, end = match.span()
119
start_line = last_start_line + self.text.count('\n', last_start, start)
120
end_line = last_start_line + self.text.count('\n', last_start, end)
0 commit comments