diff options
author | dirkf <fieldhouse@gmx.net> | 2025-03-07 19:17:18 +0000 |
---|---|---|
committer | dirkf <fieldhouse@gmx.net> | 2025-03-11 02:00:24 +0000 |
commit | 974c7d7f349831cf32026ec57e75bc821843a07b (patch) | |
tree | ae5bff4e4e0a9e9fb041e779997db867a35cce31 | |
parent | 8738407d77f6da843f8f5ded1ccad73172b4abac (diff) |
[compat] Fix inheriting from compat_collections_chain_map
* see ytdl-org/youtube-dl#33079#issuecomment-2704038049
-rw-r--r-- | youtube_dl/compat.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/youtube_dl/compat.py b/youtube_dl/compat.py index 6cd7abd24..8910a4dac 100644 --- a/youtube_dl/compat.py +++ b/youtube_dl/compat.py @@ -3473,11 +3473,12 @@ except ImportError: def new_child(self, m=None, **kwargs): m = m or {} m.update(kwargs) - return compat_collections_chain_map(m, *self.maps) + # support inheritance ! + return type(self)(m, *self.maps) @property def parents(self): - return compat_collections_chain_map(*(self.maps[1:])) + return type(self)(*(self.maps[1:])) # compat_re_Pattern, compat_re_Match |