Merge pull request #165 from bkvirendra/patch-2
Update twython.py (Attribute error, unicode object detected)
This commit is contained in:
commit
2b0b26d3ed
1 changed files with 6 additions and 1 deletions
|
|
@ -186,7 +186,12 @@ class Twython(object):
|
||||||
# why? twitter will return invalid json with an error code in the headers
|
# why? twitter will return invalid json with an error code in the headers
|
||||||
json_error = False
|
json_error = False
|
||||||
try:
|
try:
|
||||||
content = content.json()
|
try:
|
||||||
|
# try to get json
|
||||||
|
content = content.json()
|
||||||
|
except AttributeError:
|
||||||
|
# if unicode detected
|
||||||
|
content = json.loads(content)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
json_error = True
|
json_error = True
|
||||||
content = {}
|
content = {}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue