Use Pyrogram's List when consuming generators

This will pretty print them when using non-async methods
This commit is contained in:
Dan 2021-03-19 17:42:05 +01:00
parent 54ad043a70
commit b8cd08adb0

View File

@ -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):