@@ -455,13 +455,13 @@ def __getitem__(
455455 if isinstance (index , (str , list , tuple )):
456456 return self .get_function (index )
457457 if not isinstance (index , int ):
458- raise TypeError ("invalid sequence indices type" )
458+ raise TypeError ("Invalid sequence indices type" )
459459 len_self = len (lst )
460460 if index < 0 :
461461 # support negative indexes
462462 index = len_self + index
463463 if index < 0 or index >= len_self :
464- raise IndexError ("sequence index out of range" )
464+ raise IndexError ("Sequence index out of range" )
465465 return self .get_function (lst [index ])
466466
467467 def __iter__ (self ) -> Iterator [ImageFile ]:
@@ -641,7 +641,7 @@ def _get_image(
641641 if self .inline_images is None :
642642 self .inline_images = self ._get_inline_images ()
643643 if self .inline_images is None : # pragma: no cover
644- raise KeyError ("no inline image can be found" )
644+ raise KeyError ("No inline image can be found" )
645645 return self .inline_images [id ]
646646
647647 imgd = _xobj_to_image (cast (DictionaryObject , xobjs [id ]))
@@ -986,7 +986,7 @@ def _content_stream_rename(
986986 if isinstance (op , NameObject ):
987987 operands [i ] = rename .get (op , op )
988988 else :
989- raise KeyError (f"type of operands is { type (operands )} " )
989+ raise KeyError (f"Type of operands is { type (operands )} " )
990990 return stream
991991
992992 @staticmethod
@@ -2498,13 +2498,13 @@ def __getitem__(
24982498 cls = type (self )
24992499 return cls (indices .__len__ , lambda idx : self [indices [idx ]])
25002500 if not isinstance (index , int ):
2501- raise TypeError ("sequence indices must be integers" )
2501+ raise TypeError ("Sequence indices must be integers" )
25022502 len_self = len (self )
25032503 if index < 0 :
25042504 # support negative indexes
25052505 index = len_self + index
25062506 if index < 0 or index >= len_self :
2507- raise IndexError ("sequence index out of range" )
2507+ raise IndexError ("Sequence index out of range" )
25082508 return self .get_function (index )
25092509
25102510 def __delitem__ (self , index : Union [int , slice ]) -> None :
@@ -2517,13 +2517,13 @@ def __delitem__(self, index: Union[int, slice]) -> None:
25172517 del self [p ] # recursive call
25182518 return
25192519 if not isinstance (index , int ):
2520- raise TypeError ("index must be integers" )
2520+ raise TypeError ("Index must be integers" )
25212521 len_self = len (self )
25222522 if index < 0 :
25232523 # support negative indexes
25242524 index = len_self + index
25252525 if index < 0 or index >= len_self :
2526- raise IndexError ("index out of range" )
2526+ raise IndexError ("Index out of range" )
25272527 ind = self [index ].indirect_reference
25282528 assert ind is not None
25292529 parent : Optional [PdfObject ] = cast (DictionaryObject , ind .get_object ()).get (
0 commit comments