File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2371,7 +2371,7 @@ def convert_missing_indexer(indexer):
2371
2371
indexer = indexer ["key" ]
2372
2372
2373
2373
if isinstance (indexer , bool ):
2374
- raise TypeError ("cannot use a single bool to index into setitem" )
2374
+ raise KeyError ("cannot use a single bool to index into setitem" )
2375
2375
return indexer , True
2376
2376
2377
2377
return indexer , False
Original file line number Diff line number Diff line change @@ -954,9 +954,9 @@ def test_getitem_setitem_ix_bool_keyerror(self):
954
954
df .loc [True ]
955
955
956
956
msg = "cannot use a single bool to index into setitem"
957
- with pytest .raises (TypeError , match = msg ):
957
+ with pytest .raises (KeyError , match = msg ):
958
958
df .loc [False ] = 0
959
- with pytest .raises (TypeError , match = msg ):
959
+ with pytest .raises (KeyError , match = msg ):
960
960
df .loc [True ] = 0
961
961
962
962
# TODO: rename? remove?
You can’t perform that action at this time.
0 commit comments