projects
/
tweepy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c5bd51
)
Improve and optimize Model.__getstate__
author
Harmon
<Harmon758@gmail.com>
Fri, 19 Nov 2021 15:16:57 +0000
(09:16 -0600)
committer
Harmon
<Harmon758@gmail.com>
Fri, 19 Nov 2021 15:16:57 +0000
(09:16 -0600)
Resolves #1707
tweepy/models.py
patch
|
blob
|
blame
|
history
diff --git
a/tweepy/models.py
b/tweepy/models.py
index c77000dc6d7981b9ba129268b8981c04ec5d0949..245aa7a71ff77147b2521ac6d65651fac319dc04 100644
(file)
--- a/
tweepy/models.py
+++ b/
tweepy/models.py
@@
-13,12
+13,8
@@
class Model:
self._api = api
def __getstate__(self):
- # pickle
- pickle = dict(self.__dict__)
- try:
- del pickle['_api'] # do not pickle the API reference
- except KeyError:
- pass
+ pickle = self.__dict__.copy()
+ pickle.pop('_api', None)
return pickle
@classmethod