Convert regular format strings to f-strings

This fixes the 'consider-using-f-string' pylint warnings
This commit is contained in:
Timo Ludwig 2021-11-05 22:24:23 +01:00 committed by mbarkhau
parent 48da0a51bf
commit b3e7228189
2 changed files with 10 additions and 10 deletions

View file

@ -276,9 +276,9 @@ def _update_config_val(filename, **kwargs):
new_cfg_text = old_cfg_text
for key, val in kwargs.items():
replacement = "{} = {}".format(key, val)
replacement = f"{key} = {val}"
if replacement not in new_cfg_text:
pattern = r"^{} = .*$".format(key)
pattern = fr"^{key} = .*$"
new_cfg_text = re.sub(pattern, replacement, new_cfg_text, flags=re.MULTILINE)
assert old_cfg_text != new_cfg_text