[PR #11879/77509be2 backport][stable-12] Replace .format() calls with f-strings across multiple plugins (#11881)

Replace .format() calls with f-strings across multiple plugins (#11879)

* Replace .format() calls with f-strings across multiple plugins



* Add changelog fragment for PR 11879



---------


(cherry picked from commit 77509be2aa)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
patchback[bot]
2026-04-19 12:49:29 +02:00
committed by GitHub
parent 6458abb9c1
commit 748882dfa8
15 changed files with 88 additions and 114 deletions

View File

@@ -605,7 +605,8 @@ def main():
if vars is None:
return "null"
elif isinstance(vars, str):
return '"{string}"'.format(string=vars.replace("\\", "\\\\").replace('"', '\\"')).replace("\n", "\\n")
escaped = vars.replace("\\", "\\\\").replace('"', '\\"')
return f'"{escaped}"'.replace("\n", "\\n")
elif isinstance(vars, bool):
if vars:
return "true"