mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-12-10 08:36:48 +01:00
parent
c5e3f84972
commit
c07a39ae8e
2 changed files with 6 additions and 2 deletions
|
|
@ -4168,6 +4168,10 @@ class LazyList(collections.abc.Sequence):
|
|||
|
||||
|
||||
class PagedList:
|
||||
|
||||
class IndexError(IndexError):
|
||||
pass
|
||||
|
||||
def __len__(self):
|
||||
# This is only useful for tests
|
||||
return len(self.getslice())
|
||||
|
|
@ -4198,7 +4202,7 @@ class PagedList:
|
|||
raise TypeError('indices must be non-negative integers')
|
||||
entries = self.getslice(idx, idx + 1)
|
||||
if not entries:
|
||||
raise IndexError()
|
||||
raise self.IndexError()
|
||||
return entries[0]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue