From 1f0795f1d3990b75b607818f54eb05a50b6c4115 Mon Sep 17 00:00:00 2001 From: RR2DO2 Date: Tue, 29 Sep 2015 11:48:31 +0100 Subject: [PATCH] Don't intercept HTTP errors before OAuthlib can handle them As per https://github.com/requests/requests-oauthlib/issues/178#issuecomment-142280502 - the addition of this line caused a regression; the HTTP errors aren't passed on to OAuthlib anymore breaking the exceptions that would normally be raised. --- requests_oauthlib/oauth2_session.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/requests_oauthlib/oauth2_session.py b/requests_oauthlib/oauth2_session.py index ec52506d..5a062977 100644 --- a/requests_oauthlib/oauth2_session.py +++ b/requests_oauthlib/oauth2_session.py @@ -198,8 +198,6 @@ def fetch_token(self, token_url, code=None, authorization_response=None, log.debug('Invoking hook %s.', hook) r = hook(r) - r.raise_for_status() - self._client.parse_request_body_response(r.text, scope=self.scope) self.token = self._client.token log.debug('Obtained token %s.', self.token)