diff options
author | Emilio Pozuelo Monfort <pochu@debian.org> | 2020-07-17 14:29:29 +0200 |
---|---|---|
committer | Emilio Pozuelo Monfort <pochu@debian.org> | 2020-07-29 10:20:41 +0200 |
commit | 4ce8430f8916aeeadaebfcb33a81a06c56d2dfd2 (patch) | |
tree | 738379b0d242c05fdaf20324ff4f585eb0760a59 /lib | |
parent | 9ec7434f703e896addff57b410ec0addcf224391 (diff) |
bugs.py: sort using a lambda key function
Diffstat (limited to 'lib')
-rw-r--r-- | lib/python/bugs.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/python/bugs.py b/lib/python/bugs.py index 63cae22747..789232604c 100644 --- a/lib/python/bugs.py +++ b/lib/python/bugs.py @@ -291,15 +291,8 @@ class Bug(BugBase): # The release part of a key can be None, so we have to deal # with that when sorting. - def compare(a, b): - r = cmp(a[0], b[0]) - if r: - return r - ar = str(a[1] or '') - br = str(b[1] or '') - return cmp(ar, br) - l.sort(key=functools.cmp_to_key(compare)) - + l.sort(key=lambda n: (n[0], str(n[1] or ''))) + nts = [] for key in l: nts.append(notes[key]) |