Cleanup: replace %-formatting with str.format in tools/ & release/

This commit is contained in:
Campbell Barton
2024-04-27 16:06:53 +10:00
parent 5088b0154d
commit e5fb4ad03b
14 changed files with 98 additions and 94 deletions

View File

@@ -59,7 +59,7 @@ def repr_f32(f):
f_test = round(f, i)
f_test_round = round_float_32(f_test)
if f_test_round == f_round:
return "%.*f" % (i, f_test)
return "{:.{:d}f}".format(f_test, i)
return f_str

View File

@@ -46,7 +46,7 @@ class PrintStructC99(gdb.Command):
print(' ' * hs + '.' + rr_s[0] + '= ' + rr_rval)
print('Running GDB from: %s\n' % (gdb.PYTHONDIR))
print('Running GDB from: {:s}\n'.format(gdb.PYTHONDIR))
gdb.execute("set print pretty")
gdb.execute('set pagination off')
gdb.execute('set print repeats 0')