Skip to content
Myr

Merge pull request #2553 from sigmavirus24/bug/2552

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Simplify PreparedRequest.prepare API

authored by Cory Benfield · committed by Cory Benfield · parents 16eeee1, 35045e8 · Browse files · 2 files+4 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+4 added−1 removed

  • other:+4 added−1 removed

2 files+4 added−1 removed

modified:requests/models.py+4 added
521 unmodified lines
522 self.headers['Cookie'] = cookie_header523524 def prepare_hooks(self, hooks):525 """Prepares the given hooks."""526 # hooks can be passed as None to the prepare method and to this527 # method. To prevent iterating over None, simply use an empty list528 # if hooks is False-y529 hooks = hooks or []530 for event in hooks:531 self.register_hook(event, hooks[event])532533
326 unmodified lines
modified:test_requests.py-1 removed
1611 unmodified lines
1612 p = PreparedRequest()1613 p.prepare(1614 method='GET',1615 url=u('http://www.example.com/üniçø∂é'),1616 hooks=[]1616 )1617 assert_copy(p, p.copy())16181619
19 unmodified lines