Fix get_running_loop usage in Python3.6 (#3941)

Closes #3939.
This commit is contained in:
Alfian Pangetsu
2022-10-03 00:05:11 +07:00
committed by GitHub
parent 7f472ee72c
commit 908375ac42
3 changed files with 15 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ import struct
import inspect
import logging
import functools
import sys
from pathlib import Path
from hashlib import sha1
@@ -423,3 +424,9 @@ class _FileStream(io.IOBase):
pass
# endregion
def get_running_loop():
if sys.version_info[:2] <= (3, 6):
return asyncio._get_running_loop()
return asyncio.get_running_loop()