From a6de1c81bc3e9343ee965e4b8034d966604e4fd2 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 5150438fc..cec9f5516 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