mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
fix: use more generic get approach
This commit is contained in:
parent
54da4d2f2b
commit
680e4c1e9c
1 changed files with 3 additions and 3 deletions
|
|
@ -34,9 +34,9 @@ def _ensure_loop(x):
|
|||
f"not {type(x)!r}"
|
||||
|
||||
|
||||
if callable(getattr(asyncio, "create_task")):
|
||||
try:
|
||||
_asyncio_create_task = asyncio.create_task
|
||||
else:
|
||||
except AttributeError:
|
||||
from asyncio import events as _asyncio_events
|
||||
|
||||
def _asyncio_create_task(coro, *, name=None):
|
||||
|
|
@ -121,7 +121,7 @@ class Dispatcher(DataMixin, ContextInstanceMixin):
|
|||
if self._main_loop is not None:
|
||||
self._dispatcher_close_waiter = self._main_loop.create_future()
|
||||
else:
|
||||
self._dispatcher_close_waiter = asyncio.get_running_loop().create_future()
|
||||
self._dispatcher_close_waiter = asyncio.get_event_loop().create_future()
|
||||
return self._dispatcher_close_waiter
|
||||
|
||||
def _setup_filters(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue