Kaydet (Commit) cfbd41ca authored tarafından Chris St. Pierre's avatar Chris St. Pierre

Fix APIError for requests 1.1

requests 1.1, which is what's available on CentOS 6, doesn't support
passing the response code as a keyword argument.  It can be set after
the fact on both requests 1.1 and 1.2.

Docker-DCO-1.1-Signed-off-by: Chris St. Pierre <chris.a.st.pierre@gmail.com> (github: stpierre)
üst 4b090441
......@@ -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
......
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