From 274fa72a8c4f33a5fa85ad411af121a5b7b2c6df Mon Sep 17 00:00:00 2001 From: "Dmitry D. Chernov" Date: Fri, 8 Feb 2019 01:51:16 +1000 Subject: [PATCH] Correctly proxy __class__ in TakeoutClient for #1103 (#1105) --- telethon/client/account.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/telethon/client/account.py b/telethon/client/account.py index dc61038e..083a093b 100644 --- a/telethon/client/account.py +++ b/telethon/client/account.py @@ -61,8 +61,11 @@ class _TakeoutClient: wrapped[0] if single else wrapped, ordered=ordered) def __getattribute__(self, name): - if name[:2] == '__': + if name.startswith('__'): # We want to override special method names + if name == '__class__': + # See https://github.com/LonamiWebs/Telethon/issues/1103. + name = 'k' return super().__getattribute__(name) value = getattr(super().__getattribute__('c'), name)