From 448ddfd7212e8b2e6a9cb38066c86df6e4346bd1 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Mon, 5 Oct 2015 20:20:11 -0400 Subject: [PATCH] Holidays: added cmp() for Python3 --- gramps/plugins/lib/holidays.xml.in | 2 +- gramps/plugins/lib/libholiday.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gramps/plugins/lib/holidays.xml.in b/gramps/plugins/lib/holidays.xml.in index caf674d0b..8acdf9815 100644 --- a/gramps/plugins/lib/holidays.xml.in +++ b/gramps/plugins/lib/holidays.xml.in @@ -404,7 +404,7 @@ - + diff --git a/gramps/plugins/lib/libholiday.py b/gramps/plugins/lib/libholiday.py index 1a580786c..796ea671f 100644 --- a/gramps/plugins/lib/libholiday.py +++ b/gramps/plugins/lib/libholiday.py @@ -138,6 +138,12 @@ def dow(y, m, d): """ Return the ISO day of week for the given year, month and day. """ return datetime.date(y, m, d).isoweekday() +def cmp(a, b): + """ + Replacement for older Python's cmp. + """ + return (a > b) - (a < b) + #------------------------------------------------------------------------ # # HolidayTable