aboutsummaryrefslogtreecommitdiff
path: root/urllib3/response.py
diff options
context:
space:
mode:
authorSVN-Git Migration <python-modules-team@lists.alioth.debian.org>2015-10-08 13:19:32 -0700
committerSVN-Git Migration <python-modules-team@lists.alioth.debian.org>2015-10-08 13:19:32 -0700
commite5b66555b54a9854b340975471e8cdfa64e311f7 (patch)
tree21c6529cbca37472e7d77b1b55014a9f6f27687b /urllib3/response.py
parent77245469d4fbd400c6702cde35f9d9002540663e (diff)
downloadpython-urllib3-e5b66555b54a9854b340975471e8cdfa64e311f7.tar
python-urllib3-e5b66555b54a9854b340975471e8cdfa64e311f7.tar.gz
Imported Upstream version 1.5
Diffstat (limited to 'urllib3/response.py')
-rw-r--r--urllib3/response.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/urllib3/response.py b/urllib3/response.py
index 5fab824..28537d3 100644
--- a/urllib3/response.py
+++ b/urllib3/response.py
@@ -10,7 +10,7 @@ import zlib
from io import BytesIO
-from .exceptions import HTTPError
+from .exceptions import DecodeError
from .packages.six import string_types as basestring
@@ -148,9 +148,9 @@ class HTTPResponse(object):
try:
if decode_content and decoder:
data = decoder(data)
- except IOError:
- raise HTTPError("Received response with content-encoding: %s, but "
- "failed to decode it." % content_encoding)
+ except (IOError, zlib.error):
+ raise DecodeError("Received response with content-encoding: %s, but "
+ "failed to decode it." % content_encoding)
if cache_content:
self._body = data