From 596a96fb5e5b069548055488c37eea87ce4b7fd9 Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Sun, 30 Sep 2012 11:55:38 +0100 Subject: Programmatically decide on the version of mycmp to use based on offlineimap.__version__ --- .offlineimap.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.offlineimap.py b/.offlineimap.py index eb6a9bf..89a81bd 100644 --- a/.offlineimap.py +++ b/.offlineimap.py @@ -23,8 +23,12 @@ def mycmp_oldofflineimap(x, y): def mycmp_newofflineimap(x, y): for prefix in prioritized: - xsw = x.visiblename.startswith(prefix) - ysw = y.visiblename.startswith(prefix) + if offlineimap.__version__ < '6.4': + xsw = x.startswith(prefix) + ysw = y.startswith(prefix) + else: + xsw = x.visiblename.startswith(prefix) + ysw = y.visiblename.startswith(prefix) if xsw and ysw: return cmp(x, y) elif xsw: -- cgit v1.2.3