aboutsummaryrefslogtreecommitdiff
path: root/requests/exceptions.py
diff options
context:
space:
mode:
authorSVN-Git Migration <python-modules-team@lists.alioth.debian.org>2015-10-08 13:41:26 -0700
committerSVN-Git Migration <python-modules-team@lists.alioth.debian.org>2015-10-08 13:41:26 -0700
commitc6ee35e00c5709435b3a6b664c44fceb70a918c6 (patch)
tree816307f3c7e1c80f1dd49d617e480e95198d9c18 /requests/exceptions.py
parent9f376f89bdf80a40914218d64cd9cd61b25f449d (diff)
downloadpython-requests-c6ee35e00c5709435b3a6b664c44fceb70a918c6.tar
python-requests-c6ee35e00c5709435b3a6b664c44fceb70a918c6.tar.gz
Imported Upstream version 1.2.0
Diffstat (limited to 'requests/exceptions.py')
-rw-r--r--requests/exceptions.py6
1 files changed, 5 insertions, 1 deletions
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):