Merge pull request #2553 from sigmavirus24/bug/2552

Simplify PreparedRequest.prepare API
This commit is contained in:
Cory Benfield
2015-04-21 06:59:55 +01:00
2 changed files with 4 additions and 1 deletions
+4
View File
@@ -523,6 +523,10 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
def prepare_hooks(self, hooks):
"""Prepares the given hooks."""
# hooks can be passed as None to the prepare method and to this
# method. To prevent iterating over None, simply use an empty list
# if hooks is False-y
hooks = hooks or []
for event in hooks:
self.register_hook(event, hooks[event])
-1
View File
@@ -1613,7 +1613,6 @@ def test_prepare_unicode_url():
p.prepare(
method='GET',
url=u('http://www.example.com/üniçø∂é'),
hooks=[]
)
assert_copy(p, p.copy())