mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-13 15:37:02 +00:00
Use "key" instead of "cmp" when sorting excuses
Python3 has deprecated the "cmp" style sorting. Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
ede3a592a8
commit
e1b98db809
@ -195,6 +195,7 @@ from migrationitem import MigrationItem, HintItem
|
||||
from hints import HintCollection
|
||||
from britney import buildSystem
|
||||
from functools import reduce
|
||||
from operator import attrgetter
|
||||
|
||||
__author__ = 'Fabio Tranchitella and the Debian Release Team'
|
||||
__version__ = '2.0'
|
||||
@ -1595,7 +1596,7 @@ class Britney:
|
||||
self.excuses.append(excuse)
|
||||
|
||||
# sort the excuses by daysold and name
|
||||
self.excuses.sort(lambda x, y: cmp(x.daysold, y.daysold) or cmp(x.name, y.name))
|
||||
self.excuses.sort(key=attrgetter('daysold', 'name'))
|
||||
|
||||
# extract the not considered packages, which are in the excuses but not in upgrade_me
|
||||
unconsidered = [e.name for e in self.excuses if e.name not in upgrade_me]
|
||||
|
Loading…
x
Reference in New Issue
Block a user