Skip to content

Commit 6fc8419

Browse files
committedFeb 5, 2024
TO REMOVE: for debugging github ci on Windows
1 parent 3fb63f7 commit 6fc8419

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎pypdf/_page.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2216,13 +2216,13 @@ def __getitem__(
22162216
cls = type(self)
22172217
return cls(indices.__len__, lambda idx: self[indices[idx]])
22182218
if not isinstance(index, int):
2219-
raise TypeError("sequence indices must be integers")
2219+
raise TypeError("sequence indices must be integers") from TypeError(f"index = {index}")
22202220
len_self = len(self)
22212221
if index < 0:
22222222
# support negative indexes
22232223
index = len_self + index
22242224
if index < 0 or index >= len_self:
2225-
raise IndexError("sequence index out of range")
2225+
raise IndexError("sequence index out of range") from IndexError(f"size = {len_self}, index: {index}")
22262226
return self.get_function(index)
22272227

22282228
def __delitem__(self, index: Union[int, slice]) -> None:

0 commit comments

Comments
 (0)