summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2022-02-15 20:05:55 +1300
committerAndrew Bartlett <abartlet@samba.org>2022-03-17 01:36:59 +0000
commitdef505e68be66e0179a345d3f7e2bd930712e150 (patch)
tree2929c96602ad0f1bab6631994691fb59b1fa2fc8 /buildtools
parent005866b10922c8dd59d334f1a77712be33213986 (diff)
downloadsamba-def505e68be66e0179a345d3f7e2bd930712e150.tar.gz
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 <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Mar 17 01:36:59 UTC 2022 on sn-devel-184
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/samba_deps.py6
1 files changed, 3 insertions, 3 deletions
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)))