@@ -101,7 +101,6 @@ class IndexingError(Exception):
101101
102102class _NDFrameIndexer (_NDFrameIndexerBase ):
103103 _valid_types = None # type: str
104- _exception = Exception
105104 axis = None
106105
107106 def __call__ (self , axis = None ):
@@ -881,14 +880,6 @@ def _handle_lowerdim_multi_index_axis0(self, tup: Tuple):
881880 # else IndexingError will be raised
882881 if len (tup ) <= self .obj .index .nlevels and len (tup ) > self .ndim :
883882 raise ek
884- except Exception as e1 :
885- if isinstance (tup [0 ], (slice , Index )):
886- raise IndexingError ("Handle elsewhere" )
887-
888- # raise the error if we are not sorted
889- ax0 = self .obj ._get_axis (0 )
890- if not ax0 .is_lexsorted_for_tuple (tup ):
891- raise e1
892883
893884 return None
894885
@@ -1385,8 +1376,6 @@ def _convert_for_reindex(self, key, axis: int):
13851376
13861377
13871378class _LocationIndexer (_NDFrameIndexer ):
1388- _exception = Exception
1389-
13901379 def __getitem__ (self , key ):
13911380 if type (key ) is tuple :
13921381 key = tuple (com .apply_if_callable (x , self .obj ) for x in key )
@@ -1417,10 +1406,7 @@ def _getbool_axis(self, key, axis: int):
14171406 labels = self .obj ._get_axis (axis )
14181407 key = check_bool_indexer (labels , key )
14191408 inds = key .nonzero ()[0 ]
1420- try :
1421- return self .obj .take (inds , axis = axis )
1422- except Exception as detail :
1423- raise self ._exception (detail )
1409+ return self .obj .take (inds , axis = axis )
14241410
14251411 def _get_slice_axis (self , slice_obj : slice , axis : int ):
14261412 """ this is pretty simple as we just have to deal with labels """
@@ -1685,7 +1671,6 @@ class _LocIndexer(_LocationIndexer):
16851671 "endpoints included! Can be slices of integers if the "
16861672 "index is integers), listlike of labels, boolean"
16871673 )
1688- _exception = KeyError
16891674
16901675 @Appender (_NDFrameIndexer ._validate_key .__doc__ )
16911676 def _validate_key (self , key , axis : int ):
@@ -1970,7 +1955,6 @@ class _iLocIndexer(_LocationIndexer):
19701955 "integer, integer slice (START point is INCLUDED, END "
19711956 "point is EXCLUDED), listlike of integers, boolean array"
19721957 )
1973- _exception = IndexError
19741958 _get_slice_axis = _NDFrameIndexer ._get_slice_axis
19751959
19761960 def _validate_key (self , key , axis : int ):
0 commit comments