diff options
author | felix <felix.von.s@posteo.de> | 2022-02-04 14:37:02 +0100 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-04-18 04:26:43 +0530 |
commit | 77f9033095cd8e1092a80db67f2b577cf13f95a8 (patch) | |
tree | d3124c5be0d7b00d225da2edd1f5f7e244aef88f /yt_dlp/compat/asyncio/__init__.py | |
parent | 19a0394044bfad36cd665450271b8eb048a41c02 (diff) | |
download | hypervideo-pre-77f9033095cd8e1092a80db67f2b577cf13f95a8.tar.lz hypervideo-pre-77f9033095cd8e1092a80db67f2b577cf13f95a8.tar.xz hypervideo-pre-77f9033095cd8e1092a80db67f2b577cf13f95a8.zip |
[compat] Split into sub-modules (#2173)
Authored by: fstirlitz, pukkandan
Diffstat (limited to 'yt_dlp/compat/asyncio/__init__.py')
-rw-r--r-- | yt_dlp/compat/asyncio/__init__.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/yt_dlp/compat/asyncio/__init__.py b/yt_dlp/compat/asyncio/__init__.py new file mode 100644 index 000000000..0e8c6cad3 --- /dev/null +++ b/yt_dlp/compat/asyncio/__init__.py @@ -0,0 +1,16 @@ +# flake8: noqa: F405 + +from asyncio import * # noqa: F403 + +from . import tasks # noqa: F401 + +try: + run # >= 3.7 +except NameError: + def run(coro): + try: + loop = get_event_loop() + except RuntimeError: + loop = new_event_loop() + set_event_loop(loop) + loop.run_until_complete(coro) |