Skip to content

Commit 0a143f2

Browse files
Improve error message
1 parent 6c887e6 commit 0a143f2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pandas/core/indexes/interval.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -769,10 +769,8 @@ def get_loc(self, key, method=None):
769769
try:
770770
start, stop = self._find_non_overlapping_monotonic_bounds(key)
771771
except TypeError:
772-
# get loc should raise KeyError
773-
# if key is hashable but
774-
# of an incorrect type
775-
raise KeyError
772+
# get_loc should raise KeyError
773+
raise KeyError('key is hashable but of incorrect type')
776774

777775
if start is None or stop is None:
778776
return slice(start, stop)

0 commit comments

Comments
 (0)