summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <pochu@debian.org>2020-07-17 14:29:29 +0200
committerEmilio Pozuelo Monfort <pochu@debian.org>2020-07-29 10:20:41 +0200
commitd1cf4a37d919e273852d42060f5a24ac6809c1e7 (patch)
tree718096df1f99aa0aa4a362e5a31f83079c12c4de /lib
parent590a1fbff263047de706f9e8e01e93f3b66f3bd9 (diff)
bugs.py: sort using a lambda key function
Diffstat (limited to 'lib')
-rw-r--r--lib/python/bugs.py11
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])

© 2014-2024 Faster IT GmbH | imprint | privacy policy