diff options
| author | dirkf <fieldhouse@gmx.net> | 2025-11-04 23:48:37 +0000 |
|---|---|---|
| committer | dirkf <fieldhouse@gmx.net> | 2025-11-21 01:52:11 +0000 |
| commit | 931e15621cadbdeea4e16c533177d749f159b6e3 (patch) | |
| tree | 27cdde68155a1eb21ef5c36496d757e08258deb8 /youtube_dl/compat.py | |
| parent | 27867cc814b60b7a9e95de4e971a3743f33bbd96 (diff) | |
[compat] Add `compat_abc_ABC`
Base class for abstract classes
Diffstat (limited to 'youtube_dl/compat.py')
| -rw-r--r-- | youtube_dl/compat.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/youtube_dl/compat.py b/youtube_dl/compat.py index 25fbc8edd..8ebd7f742 100644 --- a/youtube_dl/compat.py +++ b/youtube_dl/compat.py @@ -55,7 +55,7 @@ except AttributeError: try: import collections.abc as compat_collections_abc except ImportError: - import collections as compat_collections_abc + compat_collections_abc = collections # compat_urllib_request @@ -3483,6 +3483,15 @@ except ImportError: from itertools import izip_longest as compat_itertools_zip_longest +# compat_abc_ABC +try: + from abc import ABC as compat_abc_ABC +except ImportError: + # Py < 3.4 + from abc import ABCMeta as _ABCMeta + compat_abc_ABC = _ABCMeta(str('ABC'), (object,), {}) + + # compat_collections_chain_map # collections.ChainMap: new class try: @@ -3677,6 +3686,7 @@ legacy = [ __all__ = [ 'compat_Struct', + 'compat_abc_ABC', 'compat_base64_b64decode', 'compat_basestring', 'compat_brotli', |
