Kaydet (Commit) 7a39cda2 authored tarafından Joffrey F's avatar Joffrey F

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

Fix APIError for requests 1.1
...@@ -35,7 +35,10 @@ STREAM_HEADER_SIZE_BYTES = 8 ...@@ -35,7 +35,10 @@ STREAM_HEADER_SIZE_BYTES = 8
class APIError(requests.exceptions.HTTPError): class APIError(requests.exceptions.HTTPError):
def __init__(self, message, response, explanation=None): 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 self.explanation = explanation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment