From: Joseph Sutton Date: Tue, 15 Feb 2022 07:05:55 +0000 (+1300) Subject: wafsamba: Fix call to sorted() X-Git-Tag: tevent-0.12.0~417 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=def505e68be66e0179a345d3f7e2bd930712e150;p=thirdparty%2Fsamba.git wafsamba: Fix call to sorted() In Python 3, sorted() does not take a 'cmp' parameter, so we need to use the 'key' parameter instead. Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Thu Mar 17 01:36:59 UTC 2022 on sn-devel-184 --- diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py index 9c922f7e036..c0a330b1b5e 100644 --- a/buildtools/wafsamba/samba_deps.py +++ b/buildtools/wafsamba/samba_deps.py @@ -1023,10 +1023,10 @@ def show_object_duplicates(bld, tgt_list): Logs.info("showing indirect dependency counts (sorted by count)") - def indirect_count(t1, t2): - return len(t2.indirect_objects) - len(t1.indirect_objects) + def indirect_count(t): + return len(t.indirect_objects) - sorted_list = sorted(tgt_list, cmp=indirect_count) + sorted_list = sorted(tgt_list, key=indirect_count, reverse=True) for t in sorted_list: if len(t.indirect_objects) > 1: Logs.info("%s depends on %u indirect objects" % (t.sname, len(t.indirect_objects)))