Code

Simplify and fix interval comparison.
[roundup.git] / roundup / date.py
index a86ed59fe0a3e909e58f040f7663c47c07d3ac21..af8d1d533c155a4bf2c6ca055a640f342cc6c5ef 100644 (file)
@@ -720,6 +720,9 @@ class Interval:
     def __cmp__(self, other):
         """Compare this interval to another interval."""
 
+        if other is None:
+            # we are always larger than None
+            return 1
         return cmp(self.as_seconds(), other.as_seconds())
 
     def __str__(self):