If bad tokens for oauth 2 obtain token, 'access_token' is never in the dict
This commit is contained in:
parent
acdf73a04e
commit
f77d9eb523
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue