From a036adc046433eccafb11841cd7eb00f90e0a02a Mon Sep 17 00:00:00 2001 From: Mykola Solodukha Date: Fri, 4 Mar 2022 22:05:25 +0200 Subject: [PATCH] :bug: Use the `Executor`'s event loop Instead of creating a new one. So that the event loop can actually be passed to `Executor()` and used in the `Executor().start_polling()` method. --- aiogram/utils/executor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiogram/utils/executor.py b/aiogram/utils/executor.py index d93af29a..9807423f 100644 --- a/aiogram/utils/executor.py +++ b/aiogram/utils/executor.py @@ -314,7 +314,7 @@ class Executor: :param timeout: """ self._prepare_polling() - loop = asyncio.get_event_loop() + loop: asyncio.AbstractEventLoop = self.loop try: loop.run_until_complete(self._startup_polling())