HEX
Server: LiteSpeed
System: Linux srv146.niagahoster.com 4.18.0-553.30.1.lve.el8.x86_64 #1 SMP Tue Dec 3 01:21:19 UTC 2024 x86_64
User: kodi1989 (1633)
PHP: 8.1.34
Disabled: symlink,shell_exec,exec,popen,system,dl,passthru,escapeshellarg,escapeshellcmd,show_source,pcntl_exec
Upload Files
File: //proc/thread-self/root/opt/alt/python37/lib/python3.7/site-packages/loguru/_asyncio_loop.py
import asyncio
import sys


def load_loop_functions():
    if sys.version_info >= (3, 7):

        def get_task_loop(task):
            return task.get_loop()

        get_running_loop = asyncio.get_running_loop

    else:

        def get_task_loop(task):
            return task._loop

        def get_running_loop():
            loop = asyncio.get_event_loop()
            if not loop.is_running():
                raise RuntimeError("There is no running event loop")
            return loop

    return get_task_loop, get_running_loop


get_task_loop, get_running_loop = load_loop_functions()