If bad tokens for oauth 2 obtain token, 'access_token' is never in the dict

This commit is contained in:
Mike Helmick 2013-06-27 22:47:07 -04:00
parent acdf73a04e
commit f77d9eb523

View file

@ -324,7 +324,7 @@ class Twython(EndpointsMixin, object):
except AttributeError:
content = json.loads(content)
access_token = content['access_token']
except (ValueError, requests.exceptions.RequestException):
except (KeyError, ValueError, requests.exceptions.RequestException):
raise TwythonAuthError('Unable to obtain OAuth 2 access token.')
else:
return access_token