From c6ee35e00c5709435b3a6b664c44fceb70a918c6 Mon Sep 17 00:00:00 2001 From: SVN-Git Migration Date: Thu, 8 Oct 2015 13:41:26 -0700 Subject: Imported Upstream version 1.2.0 --- requests/exceptions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'requests/exceptions.py') diff --git a/requests/exceptions.py b/requests/exceptions.py index 6759af5..c0588f6 100644 --- a/requests/exceptions.py +++ b/requests/exceptions.py @@ -16,7 +16,11 @@ class RequestException(RuntimeError): class HTTPError(RequestException): """An HTTP error occurred.""" - response = None + + def __init__(self, *args, **kwargs): + """ Initializes HTTPError with optional `response` object. """ + self.response = kwargs.pop('response', None) + super(HTTPError, self).__init__(*args, **kwargs) class ConnectionError(RequestException): -- cgit v1.2.3