Skip to content
Myr

Remove exception eating from dispatch_hook.

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

authored by Lucian Branescu Mihaila · committed by Lucian Branescu Mihaila · parent 4130cf9 · Browse files · 1 file+3 added−8 removed
This commit

State

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

Diff stats

1 file+3 added−8 removed

  • other:+3 added−8 removed

1 file+3 added−8 removed

modified:requests/hooks.py+3 added-8 removed
23 unmodified lines
24 The response generated from a Request.2526"""2728import traceback283029HOOKS = ('args', 'pre_request', 'pre_send', 'post_request', 'response')3031def dispatch_hook(key, hooks, hook_data):32 """Dispatches a hook dictionary on a given piece of data."""
6 unmodified lines
39 if hasattr(hooks, '__call__'):40 hooks = [hooks]4142 for hook in hooks:45 try:46 _hook_data = hook(hook_data)47 if _hook_data is not None:48 hook_data = _hook_data43 _hook_data = hook(hook_data)44 if _hook_data is not None:45 hook_data = _hook_data4650 except Exception:51 traceback.print_exc()4748 return hook_data