2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-31 22:35:36 +00:00

Make objects pickable by removing the _client attribute (#526)

This commit is contained in:
GodSaveTheDoge
2020-10-31 17:06:29 +01:00
committed by GitHub
parent e39ebdec82
commit 028e6ed04a

View File

@@ -95,3 +95,8 @@ class Object(metaclass=Meta):
def __setitem__(self, key, value):
setattr(self, key, value)
def __getstate__(self):
new_dict = self.__dict__.copy()
new_dict.pop("_client", None)
return new_dict