From 2ecf34540e601e01381bcd41ac6308c3f9299109 Mon Sep 17 00:00:00 2001 From: Steven Hiscocks Date: Sat, 23 Feb 2013 19:33:49 +0000 Subject: [PATCH] Change sort in datedetector to use key based comparison --- server/datedetector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/datedetector.py b/server/datedetector.py index c013d551..d31667fb 100644 --- a/server/datedetector.py +++ b/server/datedetector.py @@ -204,7 +204,7 @@ class DateDetector: self.__lock.acquire() try: logSys.debug("Sorting the template list") - self.__templates.sort(lambda x, y: cmp(x.getHits(), y.getHits()), reverse=True) + self.__templates.sort(key=lambda x: x.getHits(), reverse=True) t = self.__templates[0] logSys.debug("Winning template: %s with %d hits" % (t.getName(), t.getHits())) finally: