aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/utils.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-11-19 20:45:52 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-11-20 08:33:53 +0530
commitc07a39ae8e3e3b71ec8c7c0fa3e91b6908584316 (patch)
tree6f965aaec2925a6baf2e6e9a5ad1f8d018ac0d94 /yt_dlp/utils.py
parentc5e3f84972f19e8f5c99ca358cf30bb105294e20 (diff)
downloadhypervideo-pre-c07a39ae8e3e3b71ec8c7c0fa3e91b6908584316.tar.lz
hypervideo-pre-c07a39ae8e3e3b71ec8c7c0fa3e91b6908584316.tar.xz
hypervideo-pre-c07a39ae8e3e3b71ec8c7c0fa3e91b6908584316.zip
[utils] Fix `PagedList`
Bug in d8cf8d97a8dbc9602556de474af133b5ab0e0a29
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r--yt_dlp/utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py
index 282ed1f93..2d5b9892d 100644
--- a/yt_dlp/utils.py
+++ b/yt_dlp/utils.py
@@ -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]