From 944fb10733259515da149fcee8b2bc074661357a Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sat, 13 Jul 2019 21:20:51 +0200 Subject: [PATCH] Add missing return self on action/download ctx managers --- telethon/client/chats.py | 1 + telethon/client/downloads.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/telethon/client/chats.py b/telethon/client/chats.py index 91d0bd35..b85ea70c 100644 --- a/telethon/client/chats.py +++ b/telethon/client/chats.py @@ -61,6 +61,7 @@ class _ChatAction: self._running = True self._task = self._client.loop.create_task(self._update()) + return self async def __aexit__(self, *args): self._running = False diff --git a/telethon/client/downloads.py b/telethon/client/downloads.py index 67388e44..6b16fc5d 100644 --- a/telethon/client/downloads.py +++ b/telethon/client/downloads.py @@ -92,7 +92,7 @@ class _DirectDownloadIter(RequestIter): self._sender = None async def __aenter__(self): - pass + return self async def __aexit__(self, *args): await self.close()