File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -671,9 +671,8 @@ def __add__(self, other):
671
671
if hasattr (other , '_add_delta' ):
672
672
# i.e. DatetimeIndex, TimedeltaIndex, or PeriodIndex
673
673
return other ._add_delta (self )
674
- raise TypeError ("cannot add {cls} and {typ}"
675
- .format (cls = type (self ).__name__ ,
676
- typ = type (other )))
674
+ raise TypeError ("cannot add TimedeltaIndex and {typ}"
675
+ .format (typ = type (other )))
677
676
elif is_integer (other ):
678
677
return self .shift (other )
679
678
elif isinstance (other , (datetime , np .datetime64 )):
@@ -713,9 +712,8 @@ def __sub__(self, other):
713
712
assert not is_timedelta64_dtype (other )
714
713
# We checked above for timedelta64_dtype(other) so this
715
714
# must be invalid.
716
- raise TypeError ("cannot subtract {cls} and {typ}"
717
- .format (cls = type (self ).__name__ ,
718
- typ = type (other ).__name__ ))
715
+ raise TypeError ("cannot subtract TimedeltaIndex and {typ}"
716
+ .format (typ = type (other ).__name__ ))
719
717
elif isinstance (other , DatetimeIndex ):
720
718
return self ._sub_datelike (other )
721
719
elif is_integer (other ):
You can’t perform that action at this time.
0 commit comments