]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
script/show_test_time: approach python 3 compatibility
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 11 Oct 2018 03:04:38 +0000 (16:04 +1300)
committerNoel Power <npower@samba.org>
Thu, 25 Oct 2018 19:45:58 +0000 (21:45 +0200)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
script/show_test_time

index 81bb7932a4a8d90d6bc853a6ee92a194597dffa5..a35e2154275386716c67e8a9d2a17cd97e2577f7 100755 (executable)
@@ -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))