From 3ef2a652750d1da022e36e4e827eeb20cb7acb48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Tue, 5 Sep 2017 09:56:00 +0200 Subject: [PATCH] profiler: Fix sorting on Python 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lubomír Sedlář --- pungi/profiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pungi/profiler.py b/pungi/profiler.py index b1eb7c54..49bd719e 100644 --- a/pungi/profiler.py +++ b/pungi/profiler.py @@ -69,6 +69,6 @@ class Profiler(object): def print_results(cls): print("Profiling results:") results = cls._data.items() - results.sort(lambda x, y: cmp(x[1]["time"], y[1]["time"]), reverse=True) + results = sorted(results, key=lambda x: x[1]["time"], reverse=True) for name, data in results: print(" %6.2f %5d %s" % (data["time"], data["calls"], name))