misc: Use python f-strings for string formatting

This patch has been generated by applying flynt to the
gem5 repo (ext has been excluded)

JIRA: https://gem5.atlassian.net/browse/GEM5-831

Change-Id: I0935db6223d5426b99515959bde78e374cbadb04
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/68957
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
This commit is contained in:
Giacomo Travaglini
2023-03-15 13:34:46 +00:00
parent 07fca546e6
commit e73655d038
242 changed files with 814 additions and 1002 deletions

View File

@@ -136,7 +136,7 @@ def _include_matcher_main():
base, ext = m.groups()
(keyword, fname, extra) = base_matcher(context, line)
try:
if fname == "%s.%s" % (base, header_map[ext]):
if fname == f"{base}.{header_map[ext]}":
return (keyword, fname, extra)
except KeyError:
pass
@@ -342,6 +342,6 @@ if __name__ == "__main__":
dir_ignore=args.dir_ignore,
):
if args.dry_run:
print("{}: {}".format(filename, language))
print(f"{filename}: {language}")
else:
update_file(filename, filename, language, SortIncludes())