Merge branch 'develop' of github.com:kennethreitz/requests into develop

This commit is contained in:
Idan Gazit
2012-03-13 17:05:24 -07:00
2 changed files with 21 additions and 1 deletions
+12
View File
@@ -16,12 +16,24 @@ from .utils import header_expand
from .packages.urllib3.poolmanager import PoolManager
def dict_to_sequence(d):
"""Returns an internal sequence dictionary update."""
if hasattr(d, 'items'):
d = d.items()
return d
def merge_kwargs(local_kwarg, default_kwarg):
"""Merges kwarg dictionaries.
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."""