Revert "fix failing test "test_prepare_unicode_url""
authorScott Sadler <github@mashi.org>
Sun, 26 Oct 2014 11:40:05 +0000 (12:40 +0100)
committerScott Sadler <github@mashi.org>
Sun, 26 Oct 2014 11:40:05 +0000 (12:40 +0100)
This reverts commit cfd6e25749dd17c6b511043a6720b672f74029ed.

requests/models.py

index 8cc6e3b7faa97ac667c111553f9dbdb512c8c839..17e5598848d65f0907502e01828d2f9d46839932 100644 (file)
@@ -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):