Skip to content

Commit 56c7aed

Browse files
committed
fix overflow error, refs #42
1 parent 0efcb67 commit 56c7aed

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

intervals/interval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def wrapper(self, arg):
100100
return NotImplemented
101101
try:
102102
arg = type(self)(self.type(arg))
103-
except (ValueError, TypeError):
103+
except (ValueError, TypeError, OverflowError):
104104
pass
105105
return func(self, arg)
106106
return wrapper

tests/interval/test_operators.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ class TestComparisonOperators(object):
1919
DateInterval([date(2011, 1, 1), date(2011, 1, 1)]),
2020
False
2121
),
22-
(IntInterval.from_string('(,)') == None, False) # noqa
22+
(IntInterval.from_string('(,)') == None, False), # noqa
23+
(
24+
DateInterval(date(2000, 1, 1), date(2001, 1, 1)) ==
25+
-12312321312312312312123123,
26+
False
27+
)
2328
))
2429
def test_eq_operator(self, comparison, result):
2530
assert comparison is result

0 commit comments

Comments
 (0)