mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 10:31:29 +00:00
[utils] Fix LazyList for Falsey values
This commit is contained in:
parent
da503b7a52
commit
6586bca9b9
|
@ -6287,8 +6287,8 @@ def _traverse_obj(obj, path, _current_depth=0):
|
||||||
if val is not None:
|
if val is not None:
|
||||||
if depth:
|
if depth:
|
||||||
for _ in range(depth - 1):
|
for _ in range(depth - 1):
|
||||||
val = itertools.chain.from_iterable(filter(None, val))
|
val = itertools.chain.from_iterable(v for v in val if v is not None)
|
||||||
val = (list(filter(None, val)) if expected_type is None
|
val = ([v for v in val if v is not None] if expected_type is None
|
||||||
else [v for v in val if isinstance(v, expected_type)])
|
else [v for v in val if isinstance(v, expected_type)])
|
||||||
if val:
|
if val:
|
||||||
return val
|
return val
|
||||||
|
|
Loading…
Reference in a new issue