dict sequence

This commit is contained in:
Kenneth Reitz
2012-03-13 16:42:16 -07:00
parent 84d9a1b577
commit 0dd6c40205
2 changed files with 12 additions and 1 deletions
+3
View File
@@ -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
View File
@@ -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."""