From cd5ac17654467531e2dde85a738c5a170277f841 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Thu, 11 Oct 2018 16:04:38 +1300 Subject: [PATCH] script/show_test_time: approach python 3 compatibility Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power --- script/show_test_time | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/show_test_time b/script/show_test_time index 81bb7932a4a..a35e2154275 100755 --- a/script/show_test_time +++ b/script/show_test_time @@ -1,5 +1,5 @@ #!/usr/bin/python - +from __future__ import print_function import optparse import os.path import subprocess @@ -23,10 +23,10 @@ for l in p.stdout: durations[name] = float(duration) if opts.limit: - print "Top %d tests by run time:" % opts.limit + print("Top %d tests by run time:" % opts.limit) for i, (name, length) in enumerate(sorted( durations.items(), cmp=lambda (k1,v1), (k2, v2): cmp(v1, v2), reverse=True)): if opts.limit and i == opts.limit: break - print "%d: %s -> %ds" % (i+1, name, length) + print("%d: %s -> %ds" % (i+1, name, length)) -- 2.47.2