From: Daniel Lindsley Date: Fri, 12 Apr 2013 23:40:39 +0000 (-0700) Subject: Changed HTTPAdapter to allow max retries to be specified when initializing. X-Git-Tag: v1.2.1~17^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=36dcce1a06fe0a82d8522c7d4287fb3623722c6c;p=services%2Fpython-requests.git Changed HTTPAdapter to allow max retries to be specified when initializing. --- diff --git a/requests/adapters.py b/requests/adapters.py index ac76921..4245746 100644 --- a/requests/adapters.py +++ b/requests/adapters.py @@ -52,6 +52,7 @@ class HTTPAdapter(BaseAdapter): :param pool_connections: The number of urllib3 connection pools to cache. :param pool_maxsize: The maximum number of connections to save in the pool. + :param max_retries: The maximum number of retries each connection should attempt. Usage:: @@ -62,8 +63,9 @@ class HTTPAdapter(BaseAdapter): """ __attrs__ = ['max_retries', 'config', '_pool_connections', '_pool_maxsize'] - def __init__(self, pool_connections=DEFAULT_POOLSIZE, pool_maxsize=DEFAULT_POOLSIZE): - self.max_retries = DEFAULT_RETRIES + def __init__(self, pool_connections=DEFAULT_POOLSIZE, + pool_maxsize=DEFAULT_POOLSIZE, max_retries=DEFAULT_RETRIES): + self.max_retries = max_retries self.config = {} super(HTTPAdapter, self).__init__()