Fix bump-version script

This commit is contained in:
Otto Winter 2020-07-25 23:13:13 +02:00
parent e6d68d3371
commit b531d68b89
No known key found for this signature in database
GPG Key ID: 48ED2DDB96D7682C

View File

@ -45,9 +45,9 @@ class Version:
def sub(path, pattern, repl, expected_count=1):
with open(path) as fh:
content = fh.read()
content, count = re.subn(pattern, repl, content, re.MULTILINE)
content, count = re.subn(pattern, repl, content, flags=re.MULTILINE)
if expected_count is not None:
assert count == expected_count
assert count == expected_count, f"Pattern {pattern} replacement failed!"
with open(path, "wt") as fh:
fh.write(content)