Skip to content
Myr

Printing the entire traceback, instead of just a warning, when an exception is encountered

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

authored by Lucian Ursu · committed by Lucian Ursu · parent 89c90ad · Browse files · 1 file+3 added−3 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−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:requests/hooks.py+3 added-3 removed
20 unmodified lines
21 The response generated from a Request.2223"""2425import warnings25import traceback262728def dispatch_hook(key, hooks, hook_data):29 """Dispatches a hook dictionary on a given piece of data."""
3 unmodified lines
33 if key in hooks:34 try:35 return hooks.get(key).__call__(hook_data) or hook_data3637 except Exception, why:38 warnings.warn(str(why))37 except Exception:38 traceback.print_exc()3940 return hook_data