summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Konick <konick781@gmail.com>2014-09-22 15:51:59 -0400
committerTim Konick <konick781@gmail.com>2014-09-22 15:51:59 -0400
commit6e5f7bb9d397ade498ee22d9785863ef1b8ad946 (patch)
treef6ece7cb9bedcb742b40fb58c75a9b3cc4ef7a03
parent58e0a6f4a020db660119f1c9459ab37ba55b92d4 (diff)
downloadpython-requests-6e5f7bb9d397ade498ee22d9785863ef1b8ad946.tar.gz
using the `StreamConsumedError`
-rw-r--r--requests/models.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/requests/models.py b/requests/models.py
index 5974507b..897cd6fd 100644
--- a/requests/models.py
+++ b/requests/models.py
@@ -22,8 +22,9 @@ from .packages.urllib3.util import parse_url
from .packages.urllib3.exceptions import (
DecodeError, ReadTimeoutError, ProtocolError)
from .exceptions import (
- HTTPError, RequestException, MissingSchema, InvalidURL,
- ChunkedEncodingError, ContentDecodingError, ConnectionError)
+ HTTPError, RequestException, MissingSchema, InvalidURL,
+ ChunkedEncodingError, ContentDecodingError, ConnectionError,
+ StreamConsumedError)
from .utils import (
guess_filename, get_auth_from_url, requote_uri,
stream_decode_response_unicode, to_key_val_list, parse_header_links,
@@ -656,8 +657,7 @@ class Response(object):
self._content_consumed = True
if self._content_consumed and isinstance(self._content, bool):
- raise RuntimeError(
- 'The content for this response was already consumed')
+ raise StreamConsumedError()
# simulate reading small chunks of the content
reused_chunks = iter_slices(self._content, chunk_size)