Skip to content

Commit c5fdf53

Browse files
committed
revert changes handled in other PR
1 parent 25af8eb commit c5fdf53

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

pandas/core/indexes/datetimelike.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -671,9 +671,8 @@ def __add__(self, other):
671671
if hasattr(other, '_add_delta'):
672672
# i.e. DatetimeIndex, TimedeltaIndex, or PeriodIndex
673673
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)))
677676
elif is_integer(other):
678677
return self.shift(other)
679678
elif isinstance(other, (datetime, np.datetime64)):
@@ -713,9 +712,8 @@ def __sub__(self, other):
713712
assert not is_timedelta64_dtype(other)
714713
# We checked above for timedelta64_dtype(other) so this
715714
# 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__))
719717
elif isinstance(other, DatetimeIndex):
720718
return self._sub_datelike(other)
721719
elif is_integer(other):

0 commit comments

Comments
 (0)