mirror of
https://github.com/esphome/esphome.git
synced 2024-11-21 22:48:10 +01:00
Fix bump-version script
This commit is contained in:
parent
8215a018e9
commit
1c3ed71d36
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue