File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,15 +36,17 @@ def __init__(
3636 if earliest :
3737 try :
3838 earliest = Undate .to_undate (earliest )
39- except TypeError :
39+ except TypeError as err :
4040 raise ValueError (
4141 f"earliest date { earliest } cannot be converted to Undate"
42- )
42+ ) from err
4343 if latest :
4444 try :
4545 latest = Undate .to_undate (latest )
46- except TypeError :
47- raise ValueError (f"latest date { latest } cannot be converted to Undate" )
46+ except TypeError as err :
47+ raise ValueError (
48+ f"latest date { latest } cannot be converted to Undate"
49+ ) from err
4850
4951 # check that the interval is valid
5052 if latest and earliest and latest <= earliest :
@@ -123,7 +125,7 @@ def duration(self) -> Timedelta:
123125
124126 def intersection (self , other : "UndateInterval" ) -> Optional ["UndateInterval" ]:
125127 """Determine the intersection or overlap between two :class:`UndateInterval`
126- objects and return a new interval, or None if no overlap.
128+ objects and return a new interval. Returns None if there is no overlap.
127129 """
128130 try :
129131 # when both values are defined, return the inner bounds;
You can’t perform that action at this time.
0 commit comments