From 61043e93c99be7f449be6eb3a1554ebdc2d842b7 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sat, 25 Jul 2020 23:14:27 +0200 Subject: [PATCH] Fix bump-version script --- script/bump-version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/bump-version.py b/script/bump-version.py index cc0e357..2dbad17 100755 --- a/script/bump-version.py +++ b/script/bump-version.py @@ -49,9 +49,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)