diff options
author | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 13:41:26 -0700 |
---|---|---|
committer | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 13:41:26 -0700 |
commit | c6ee35e00c5709435b3a6b664c44fceb70a918c6 (patch) | |
tree | 816307f3c7e1c80f1dd49d617e480e95198d9c18 /requests/hooks.py | |
parent | 9f376f89bdf80a40914218d64cd9cd61b25f449d (diff) | |
download | python-requests-c6ee35e00c5709435b3a6b664c44fceb70a918c6.tar python-requests-c6ee35e00c5709435b3a6b664c44fceb70a918c6.tar.gz |
Imported Upstream version 1.2.0
Diffstat (limited to 'requests/hooks.py')
-rw-r--r-- | requests/hooks.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/requests/hooks.py b/requests/hooks.py index 6135033..5dfaf6b 100644 --- a/requests/hooks.py +++ b/requests/hooks.py @@ -16,6 +16,7 @@ Available hooks: HOOKS = ['response'] + def default_hooks(): hooks = {} for event in HOOKS: @@ -24,7 +25,8 @@ def default_hooks(): # TODO: response is the only one -def dispatch_hook(key, hooks, hook_data): + +def dispatch_hook(key, hooks, hook_data, **kwargs): """Dispatches a hook dictionary on a given piece of data.""" hooks = hooks or dict() @@ -36,7 +38,7 @@ def dispatch_hook(key, hooks, hook_data): hooks = [hooks] for hook in hooks: - _hook_data = hook(hook_data) + _hook_data = hook(hook_data, **kwargs) if _hook_data is not None: hook_data = _hook_data |