Merge pull request #165 from bkvirendra/patch-2

Update twython.py (Attribute error, unicode object detected)
This commit is contained in:
Mike Helmick 2013-04-08 13:38:24 -07:00
commit 2b0b26d3ed

View file

@ -186,7 +186,12 @@ class Twython(object):
# why? twitter will return invalid json with an error code in the headers
json_error = False
try:
try:
# try to get json
content = content.json()
except AttributeError:
# if unicode detected
content = json.loads(content)
except ValueError:
json_error = True
content = {}