From e907b0f04354873316311072da572943abb6281a Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Mon, 26 Sep 2022 13:00:56 +0200 Subject: Modernize via pyupgrade MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Górny --- utils/benchmark.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'utils/benchmark.py') diff --git a/utils/benchmark.py b/utils/benchmark.py index 5eb4d8d..8bca803 100755 --- a/utils/benchmark.py +++ b/utils/benchmark.py @@ -11,12 +11,12 @@ import gemato.hash def benchmark_one(path, hashes): f = lambda: gemato.hash.hash_path(path, hashes) - print("{} -> [ ".format(hashes), end='', flush=True) + print(f"{hashes} -> [ ", end='', flush=True) results = [] for t in (timeit.timeit(f, number=1) for i in range(5)): - print("{:.4}".format(t), end=" ", flush=True) + print(f"{t:.4}", end=" ", flush=True) results.append(t) - print("] -> min: {:.4}".format(min(results))) + print(f"] -> min: {min(results):.4}") def benchmark(path, hash_sets): @@ -35,7 +35,7 @@ def benchmark(path, hash_sets): if __name__ == '__main__': if len(sys.argv) < 2: - print('Usage: {} [...]'.format(sys.argv[0])) + print(f'Usage: {sys.argv[0]} [...]') sys.exit(1) benchmark(sys.argv[1], sys.argv[2:]) -- cgit v1.2.3