mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
dict sequence
This commit is contained in:
@@ -31,6 +31,9 @@ def merge_kwargs(local_kwarg, default_kwarg):
|
||||
If a local key in the dictionary is set to None, it will be removed.
|
||||
"""
|
||||
|
||||
|
||||
|
||||
|
||||
if default_kwarg is None:
|
||||
return local_kwarg
|
||||
|
||||
|
||||
+9
-1
@@ -14,7 +14,6 @@ import codecs
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
import traceback
|
||||
import zlib
|
||||
from netrc import netrc, NetrcParseError
|
||||
|
||||
@@ -26,6 +25,15 @@ from .compat import basestring, bytes, str
|
||||
NETRC_FILES = ('.netrc', '_netrc')
|
||||
|
||||
|
||||
def dict_to_sequence(d):
|
||||
"""Returns an internal sequence dictionary update."""
|
||||
|
||||
if hasattr(d, 'items'):
|
||||
d = d.items()
|
||||
|
||||
return d
|
||||
|
||||
|
||||
def get_netrc_auth(url):
|
||||
"""Returns the Requests tuple auth for a given url from netrc."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user