Use "key" instead of "cmp" when sorting excuses

Python3 has deprecated the "cmp" style sorting.

Signed-off-by: Niels Thykier <niels@thykier.net>
debian
Niels Thykier 13 years ago
parent 4a1bee1fc9
commit a717404f0d

@ -195,6 +195,7 @@ from migrationitem import MigrationItem, HintItem
from hints import HintCollection from hints import HintCollection
from britney import buildSystem from britney import buildSystem
from functools import reduce from functools import reduce
from operator import attrgetter
__author__ = 'Fabio Tranchitella and the Debian Release Team' __author__ = 'Fabio Tranchitella and the Debian Release Team'
__version__ = '2.0' __version__ = '2.0'
@ -1595,7 +1596,7 @@ class Britney:
self.excuses.append(excuse) self.excuses.append(excuse)
# sort the excuses by daysold and name # 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 # 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] unconsidered = [e.name for e in self.excuses if e.name not in upgrade_me]

Loading…
Cancel
Save