mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 12:57:52 +00:00
Make objects pickable by removing the _client attribute (#526)
This commit is contained in:
parent
e39ebdec82
commit
028e6ed04a
@ -95,3 +95,8 @@ class Object(metaclass=Meta):
|
|||||||
|
|
||||||
def __setitem__(self, key, value):
|
def __setitem__(self, key, value):
|
||||||
setattr(self, key, value)
|
setattr(self, key, value)
|
||||||
|
|
||||||
|
def __getstate__(self):
|
||||||
|
new_dict = self.__dict__.copy()
|
||||||
|
new_dict.pop("_client", None)
|
||||||
|
return new_dict
|
||||||
|
Loading…
x
Reference in New Issue
Block a user