Skip to content
Myr

Move hooks out of top-level loop

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 20e0ee4 · Browse files · 2 files+0 added−18 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+0 added−18 removed

  • other:+0 added−18 removed

2 files+0 added−18 removed

modified:requests/async.py-6 removed
43 unmodified lines
44 r._pools = pools4546 r.send()4748 # Post-request hook.49 r = dispatch_hook('post_request', r.hooks, r)5051 # Response manipulation hook.52 r.response = dispatch_hook('response', r.hooks, r.response)5348 return r.response495051# Patched requests.api functions.
27 unmodified lines
modified:requests/sessions.py-12 removed
155 unmodified lines
156 local_val = args.get(attr)157158 args[attr] = merge_kwargs(local_val, session_val)159160 # Arguments manipulation hook.161 args = dispatch_hook('args', hooks, args)162160 r = Request(**args)161165 # Pre-request hook.166 r = dispatch_hook('pre_request', hooks, r)167162 # Don't send if asked nicely.163 if not return_response:164 return r165166 # Send the HTTP Request.167 r.send()168175 # Post-request hook.176 r = dispatch_hook('post_request', hooks, r)177178 # Response manipulation hook.179 r.response = dispatch_hook('response', hooks, r.response)180169 return r.response170171172 def get(self, url, **kwargs):
69 unmodified lines