1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-06-27 17:08:32 +00:00

[devalue] better error message for self-referencing custom types

Authored by: bashonly
This commit is contained in:
bashonly 2025-06-11 12:49:08 -05:00
parent 8578e78719
commit 39cb150d76
No known key found for this signature in database
GPG Key ID: 783F096F253D15B0

View File

@ -79,7 +79,7 @@ def parse_iter(parsed: typing.Any, /, *, revivers: dict[str, collections.abc.Cal
# TODO: implement zips `strict=True`
if reviver := revivers.get(value[0]):
if value[1] == source:
yield IndexError('custom types cannot point to themselves')
yield IndexError(f'{value[0]!r} cannot point to itself (index: {source})')
continue
# inverse order: resolve index, revive value
stack.append((target, index, (value[0], value[1], reviver)))