X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=roundup%2Fdate.py;fp=roundup%2Fdate.py;h=a86ed59fe0a3e909e58f040f7663c47c07d3ac21;hb=aae24244fbc4b208adb0d0db5382407331101fe6;hp=cedc6d4954e2189605e807ca786128385357b0a8;hpb=a8a4efe2b384fea653554aa00e44013d8a612528;p=roundup.git diff --git a/roundup/date.py b/roundup/date.py index cedc6d4..a86ed59 100644 --- a/roundup/date.py +++ b/roundup/date.py @@ -719,14 +719,8 @@ class Interval: def __cmp__(self, other): """Compare this interval to another interval.""" - if other is None: - # we are always larger than None - return 1 - for attr in 'sign year month day hour minute second'.split(): - r = cmp(getattr(self, attr), getattr(other, attr)) - if r: - return r - return 0 + + return cmp(self.as_seconds(), other.as_seconds()) def __str__(self): """Return this interval as a string."""