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
commitde707ed319937a96e31d773d0891abf7b039f2ee (patch)
tree26d1cfb26c81a480c5b3377c2a32209c25995811 /lib
parent8ae68d88163932449cf8a31d9ee722f2e5732ff8 (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