Skip to content

Commit ab57c07

Browse files
author
Kenneth Reitz
committed
Merge pull request psf#811 from lucian1900/develop
Remove exception eating from dispatch_hook.
2 parents 94869e7 + 57b4d39 commit ab57c07

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

requests/hooks.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
2626
"""
2727

28-
import traceback
29-
3028

3129
HOOKS = ('args', 'pre_request', 'pre_send', 'post_request', 'response')
3230

@@ -43,12 +41,9 @@ def dispatch_hook(key, hooks, hook_data):
4341
hooks = [hooks]
4442

4543
for hook in hooks:
46-
try:
47-
_hook_data = hook(hook_data)
48-
if _hook_data is not None:
49-
hook_data = _hook_data
44+
_hook_data = hook(hook_data)
45+
if _hook_data is not None:
46+
hook_data = _hook_data
5047

51-
except Exception:
52-
traceback.print_exc()
5348

5449
return hook_data

0 commit comments

Comments
 (0)