Skip to content
Myr

Fix for #804 - Session params ommited in 0.13.8. If default_kwarg is a list, attempt to convert to dictionary

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

authored by Andrew Tolbert · committed by Andrew Tolbert · parent 4889adc · Browse files · 1 file+11 added−2 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+11 added−2 removed

  • other:+11 added−2 removed

1 file+11 added−2 removed

modified:requests/sessions.py+11 added-2 removed
32 unmodified lines
3334 if local_kwarg is None:35 return default_kwarg3637 kwargs = default_kwarg38 # If default_kwargs is a list rather than a dictionary attempt to convert39 # to dictionary. If the check fails, return local_kwargs.40 if isinstance(default_kwarg, list):41 try:42 kwargs = dict(kwargs)43 except ValueError:44 return local_kwarg4546 # Bypass if not a dictionary (e.g. timeout)38 if not hasattr(default_kwarg, 'items'):47 if not hasattr(kwargs, 'items'):48 return local_kwarg4950 local_kwarg = to_key_val_list(local_kwarg)5152 # Update new values.44 kwargs = default_kwarg.copy()53 kwargs = kwargs.copy()54 kwargs.update(local_kwarg)5556 # Remove keys that are set to None.57 for (k, v) in local_kwarg:
282 unmodified lines