script/show_test_time: attempt py3 compat
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sat, 27 Oct 2018 21:48:42 +0000 (10:48 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Thu, 1 Nov 2018 04:08:10 +0000 (05:08 +0100)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <noel.power@suse.com>
script/show_test_time

index a35e2154275386716c67e8a9d2a17cd97e2577f7..fae7b814f497e4ada0292fc7418b2ae9b8792368 100755 (executable)
@@ -26,7 +26,7 @@ if 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)):
+        durations.items(), key=lambda x: x[1], reverse=True)):
     if opts.limit and i == opts.limit:
         break
     print("%d: %s -> %ds" % (i+1, name, length))