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:
@@ -399,14 +399,14 @@ def main():
|
||||
done = True
|
||||
print("Build information:")
|
||||
print()
|
||||
print("gem5 version %s" % defines.gem5Version)
|
||||
print("compiled %s" % defines.compileDate)
|
||||
print(f"gem5 version {defines.gem5Version}")
|
||||
print(f"compiled {defines.compileDate}")
|
||||
print("build options:")
|
||||
keys = list(defines.buildEnv.keys())
|
||||
keys.sort()
|
||||
for key in keys:
|
||||
val = defines.buildEnv[key]
|
||||
print(" %s = %s" % (key, val))
|
||||
print(f" {key} = {val}")
|
||||
print()
|
||||
|
||||
if options.copyright:
|
||||
@@ -470,11 +470,11 @@ def main():
|
||||
print(brief_copyright)
|
||||
print()
|
||||
|
||||
print("gem5 version %s" % _m5.core.gem5Version)
|
||||
print("gem5 compiled %s" % _m5.core.compileDate)
|
||||
print(f"gem5 version {_m5.core.gem5Version}")
|
||||
print(f"gem5 compiled {_m5.core.compileDate}")
|
||||
|
||||
print(
|
||||
"gem5 started %s" % datetime.datetime.now().strftime("%b %e %Y %X")
|
||||
f"gem5 started {datetime.datetime.now().strftime('%b %e %Y %X')}"
|
||||
)
|
||||
print(
|
||||
"gem5 executing on %s, pid %d"
|
||||
@@ -490,7 +490,7 @@ def main():
|
||||
# check to make sure we can find the listed script
|
||||
if not options.c and (not arguments or not os.path.isfile(arguments[0])):
|
||||
if arguments and not os.path.isfile(arguments[0]):
|
||||
print("Script %s not found" % arguments[0])
|
||||
print(f"Script {arguments[0]} not found")
|
||||
|
||||
options.usage(2)
|
||||
|
||||
@@ -514,7 +514,7 @@ def main():
|
||||
elif options.listener_mode == "on":
|
||||
pass
|
||||
else:
|
||||
panic("Unhandled listener mode: %s" % options.listener_mode)
|
||||
panic(f"Unhandled listener mode: {options.listener_mode}")
|
||||
|
||||
if not options.allow_remote_connections:
|
||||
m5.listenersLoopbackOnly()
|
||||
@@ -534,7 +534,7 @@ def main():
|
||||
off = True
|
||||
|
||||
if flag not in debug.flags:
|
||||
print("invalid debug flag '%s'" % flag, file=sys.stderr)
|
||||
print(f"invalid debug flag '{flag}'", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if off:
|
||||
|
||||
Reference in New Issue
Block a user