From: Scott Sadler Date: Sun, 26 Oct 2014 11:40:05 +0000 (+0100) Subject: Revert "fix failing test "test_prepare_unicode_url"" X-Git-Tag: v2.5.0~15^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77687de5099b6b65cde5901a29a3b1c5e751b8a2;p=services%2Fpython-requests.git Revert "fix failing test "test_prepare_unicode_url"" This reverts commit cfd6e25749dd17c6b511043a6720b672f74029ed. --- diff --git a/requests/models.py b/requests/models.py index 8cc6e3b..17e5598 100644 --- a/requests/models.py +++ b/requests/models.py @@ -22,8 +22,8 @@ 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, @@ -511,9 +511,8 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): def prepare_hooks(self, hooks): """Prepares the given hooks.""" - if hooks is not None: - for event in hooks: - self.register_hook(event, hooks[event]) + for event in hooks: + self.register_hook(event, hooks[event]) class Response(object):