projects
/
tweepy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d07ecd6
)
catch exception for deleting _api model reference when pickling/ unpickling
author
Chris Kelly
<chris@ckelly.net>
Fri, 30 Apr 2010 02:24:42 +0000
(10:24 +0800)
committer
Joshua Roesslein
<jroesslein@gmail.com>
Tue, 4 May 2010 16:16:30 +0000
(
00:16
+0800)
tweepy/models.py
patch
|
blob
|
blame
|
history
diff --git
a/tweepy/models.py
b/tweepy/models.py
index 4dc67f9e3c6526b156955b9c792727709bfed52d..30ecc0fdd238cc8499f2c61b623014e38addb3aa 100644
(file)
--- a/
tweepy/models.py
+++ b/
tweepy/models.py
@@
-19,7
+19,10
@@
class Model(object):
def __getstate__(self):
# pickle
pickle = dict(self.__dict__)
- del pickle['_api'] # do not pickle the API reference
+ try:
+ del pickle['_api'] # do not pickle the API reference
+ except KeyError:
+ pass
return pickle
@classmethod