Merge pull request #165 from stpierre/fix-http-error

Fix APIError for requests 1.1
This commit is contained in:
Joffrey F 2014-02-10 16:20:19 +01:00
commit 7a39cda22a
1 changed files with 4 additions and 1 deletions

View File

@ -35,7 +35,10 @@ STREAM_HEADER_SIZE_BYTES = 8
class APIError(requests.exceptions.HTTPError):
def __init__(self, message, response, explanation=None):
super(APIError, self).__init__(message, response=response)
# requests 1.2 supports response as a keyword argument, but
# requests 1.1 doesn't
super(APIError, self).__init__(message)
self.response = response
self.explanation = explanation