From 94603f1ff255f3b44158a4f1b4acb2dad8ac5542 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 3 Aug 2019 10:36:57 +0200 Subject: [PATCH] Replace create_task with ensure_future for compatibility --- pyrogram/client/ext/dispatcher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/ext/dispatcher.py b/pyrogram/client/ext/dispatcher.py index 98d9b865..855fefe7 100644 --- a/pyrogram/client/ext/dispatcher.py +++ b/pyrogram/client/ext/dispatcher.py @@ -130,7 +130,7 @@ class Dispatcher: for lock in self.locks_list: lock.release() - asyncio.get_event_loop().create_task(fn()) + asyncio.ensure_future(fn()) def remove_handler(self, handler, group: int): async def fn(): @@ -146,7 +146,7 @@ class Dispatcher: for lock in self.locks_list: lock.release() - asyncio.get_event_loop().create_task(fn()) + asyncio.ensure_future(fn()) async def update_worker(self, lock): while True: