projects
/
twitter-api-cdsw
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
043b63c
)
Fixed key error in some tweets
author
Tommy Guy
<richardtguy84@gmail.com>
Mon, 20 Apr 2015 03:36:10 +0000
(20:36 -0700)
committer
Tommy Guy
<richardtguy84@gmail.com>
Mon, 20 Apr 2015 03:36:10 +0000
(20:36 -0700)
tweepy/models.py
patch
|
blob
|
history
diff --git
a/tweepy/models.py
b/tweepy/models.py
index 09ed3eb026a2afd412755e3f32bf47aabc538839..0db677ea140c6fe49a70ed0a464368c0eb4e4122 100644
(file)
--- a/
tweepy/models.py
+++ b/
tweepy/models.py
@@
-78,7
+78,8
@@
class Status(Model):
# I'm not proud. Blame billg.
json['text'] = str(json['text'].encode('ascii', 'ignore'))[2:-1]
# I'm not proud. Blame billg.
json['text'] = str(json['text'].encode('ascii', 'ignore'))[2:-1]
- json['user']['screen_name'] = str(json['user']['screen_name'].encode('ascii', 'ignore'))[2:-1]
+ if 'user' in json:
+ json['user']['screen_name'] = str(json['user']['screen_name'].encode('ascii', 'ignore'))[2:-1]
setattr(status, '_json', json)
for k, v in json.items():
setattr(status, '_json', json)
for k, v in json.items():
Benjamin Mako Hill
||
Want to submit a patch?