Skip to content

Commit 20ef5d1

Browse files
committed
Simplify and fix interval comparison.
1 parent daa762e commit 20ef5d1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

roundup/date.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,9 @@ def set(self, spec, allowdate=1, interval_re=re.compile('''
720720
def __cmp__(self, other):
721721
"""Compare this interval to another interval."""
722722

723+
if other is None:
724+
# we are always larger than None
725+
return 1
723726
return cmp(self.as_seconds(), other.as_seconds())
724727

725728
def __str__(self):

0 commit comments

Comments
 (0)