From 6f602a203ed675cf50ac67a1ede85e578b086df4 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sun, 26 Sep 2021 18:33:03 +0200 Subject: [PATCH] Fix custom.Forward not using the new __slots__ --- telethon/types/_custom/forward.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/telethon/types/_custom/forward.py b/telethon/types/_custom/forward.py index d6a46cb7..c5839c4b 100644 --- a/telethon/types/_custom/forward.py +++ b/telethon/types/_custom/forward.py @@ -26,7 +26,8 @@ class Forward(ChatGetter, SenderGetter): # Copy all the fields, not reference! It would cause memory cycles: # self.original_fwd.original_fwd.original_fwd.original_fwd # ...would be valid if we referenced. - self.__dict__.update(original.__dict__) + for slot in original.__slots__: + setattr(self, slot, getattr(original, slot)) self.original_fwd = original sender_id = sender = input_sender = peer = chat = input_chat = None