Skip to content

Commit 4a7dbbe

Browse files
committed
CLN: pass in Period instead of Period repr to remove extra double quotes #3179
1 parent 30fba73 commit 4a7dbbe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pandas/tseries/period.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ def get_loc(self, key):
891891
try:
892892
return self._engine.get_loc(key.ordinal)
893893
except KeyError as inst:
894-
raise KeyError(repr(key))
894+
raise KeyError(key)
895895

896896
def slice_locs(self, start=None, end=None):
897897
"""

pandas/tseries/tests/test_period.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1932,7 +1932,7 @@ def test_get_loc_msg(self):
19321932
try:
19331933
idx.get_loc(bad_period)
19341934
except KeyError as inst:
1935-
self.assert_(inst.message == repr(bad_period))
1935+
self.assert_(inst.message == bad_period)
19361936

19371937
def test_append_concat(self):
19381938
# #1815

0 commit comments

Comments
 (0)