Skip to content
Myr

clarity™

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 ed160f2 · 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/sessions.py+3 added-8 removed
17 unmodified lines
1819def merge_kwargs(local_kwarg, default_kwarg):20 """Merges kwarg dictionaries.2122 If a key in the dictionary is set to None, i22 If a local key in the dictionary is set to None, it will be removed.23 """2425 # Bypass if not a dictionary (e.g. timeout)26 if not hasattr(local_kwarg, 'items'):27 return local_kwarg2829 # Update new values.30 kwargs = default_kwarg.copy()31 kwargs.update(local_kwarg)3232 # from clint.textui import colored333435 # print colored.red(default_kwarg)36 # print colored.red(local_kwarg)3733 # Remove keys that are set to None.34 for (k,v) in local_kwarg.items():35 if v is None:36 del kwargs[k]
87 unmodified lines
124 if new_attr is not None:125 _kwargs[attr] = new_attr126127 # Make sure we didn't miss anything.133 for (k, v) in kwargs:128 for (k, v) in kwargs.items():129 if k not in _kwargs:130 _kwargs[k] = v131132 # TODO: Persist cookies.
12 unmodified lines