From: Douglas Bagnall Date: Thu, 11 Oct 2018 03:04:38 +0000 (+1300) Subject: script/show_test_time: approach python 3 compatibility X-Git-Tag: tdb-1.3.17~1159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd5ac17654467531e2dde85a738c5a170277f841;p=thirdparty%2Fsamba.git script/show_test_time: approach python 3 compatibility Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power --- 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))