mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-17 00:33:51 +01:00
fix matching of empty patterns
This commit is contained in:
parent
bce44fd240
commit
dd575bede7
2 changed files with 56 additions and 6 deletions
|
|
@ -55,7 +55,7 @@ PatternMatches = typ.Iterable[PatternMatch]
|
|||
def _iter_for_pattern(lines: typ.List[str], pattern: Pattern) -> PatternMatches:
|
||||
for lineno, line in enumerate(lines):
|
||||
match = pattern.regexp.search(line)
|
||||
if match:
|
||||
if match and len(match.group(0)) > 0:
|
||||
yield PatternMatch(lineno, line, pattern, match.span(), match.group(0))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue