From b8cd08adb02b4b7b87f15bc9351db92b20775947 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 19 Mar 2021 17:42:05 +0100 Subject: [PATCH] Use Pyrogram's List when consuming generators This will pretty print them when using non-async methods --- pyrogram/sync.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrogram/sync.py b/pyrogram/sync.py index 20bd12ac..51742945 100644 --- a/pyrogram/sync.py +++ b/pyrogram/sync.py @@ -31,7 +31,7 @@ def async_to_sync(obj, name): main_loop = asyncio.get_event_loop() async def consume_generator(coroutine): - return [i async for i in coroutine] + return types.List([i async for i in coroutine]) @functools.wraps(function) def async_to_sync_wrap(*args, **kwargs):