Fixed pickle support for requests.adapters.HTTPAdapter by adding

'proxy_manager' when unpickling.
This commit is contained in:
Erik Wickstrom
2013-12-12 16:19:50 -08:00
committed by Ian Cordasco
parent cac2077c36
commit 16f9798208
+5
View File
@@ -97,6 +97,11 @@ class HTTPAdapter(BaseAdapter):
self.init_poolmanager(self._pool_connections, self._pool_maxsize,
block=self._pool_block)
# Can't handle by adding 'proxy_manager' to self.__attrs__ because
# because self.poolmanager uses a lambda function, which isn't pickleable.
if not hasattr(self, 'proxy_manager'):
self.proxy_manager = {}
def init_poolmanager(self, connections, maxsize, block=DEFAULT_POOLBLOCK):
"""Initializes a urllib3 PoolManager. This method should not be called
from user code, and is only exposed for use when subclassing the