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

@@ -13,6 +13,8 @@ from .. import events, utils, errors
from ..events.common import EventBuilder, EventCommon
from ..tl import types, functions
from .._updates import GapError, PrematureEndReason
from ..helpers import get_running_loop
if typing.TYPE_CHECKING:
from .telegramclient import TelegramClient
@@ -358,7 +360,7 @@ class UpdateMethods:
continue
deadline = self._message_box.check_deadlines()
deadline_delay = deadline - asyncio.get_running_loop().time()
deadline_delay = deadline - get_running_loop().time()
if deadline_delay > 0:
# Don't bother sleeping and timing out if the delay is already 0 (pollutes the logs).
try: