From a717404f0d075bee48432e68f4ce66ac6c02d9ea Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sun, 18 Dec 2011 16:01:00 +0100 Subject: [PATCH] Use "key" instead of "cmp" when sorting excuses Python3 has deprecated the "cmp" style sorting. Signed-off-by: Niels Thykier --- britney.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/britney.py b/britney.py index 4ebe704..2c86ebf 100755 --- a/britney.py +++ b/britney.py @@ -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]