From f9643bf7376a5953da2050a5361c9b465f7ee7d9 Mon Sep 17 00:00:00 2001 From: Reinier Romero Mir Date: Wed, 1 Dec 2021 14:28:55 -0500 Subject: [PATCH] Add missing async when downloading from URL (#3222) --- telethon/client/downloads.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/client/downloads.py b/telethon/client/downloads.py index 62ba6332..6d7a8d65 100644 --- a/telethon/client/downloads.py +++ b/telethon/client/downloads.py @@ -962,7 +962,7 @@ class DownloadMethods: f = file try: - with aiohttp.ClientSession() as session: + async with aiohttp.ClientSession() as session: # TODO Use progress_callback; get content length from response # https://github.com/telegramdesktop/tdesktop/blob/c7e773dd9aeba94e2be48c032edc9a78bb50234e/Telegram/SourceFiles/ui/images.cpp#L1318-L1319 async with session.get(web.url) as response: