aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/compat/asyncio.py
blob: c61e5c8fdee1ab6510cf672c200f6f9ad7e11a01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# flake8: noqa: F405
from asyncio import *  # noqa: F403

from .compat_utils import passthrough_module

passthrough_module(__name__, 'asyncio')
del passthrough_module

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)

try:
    all_tasks  # >= 3.7
except NameError:
    all_tasks = Task.all_tasks