Skip to content
Myr

allow pool_kwargs to be specified in init_poolmanager

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Ben Bass · committed by Ben Bass · parent 02618c8 · Browse files · 1 file+7 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−4 removed

  • other:+7 added−4 removed

1 file+7 added−4 removed

modified:requests/adapters.py+7 added-4 removed
99 unmodified lines
100101 self.init_poolmanager(self._pool_connections, self._pool_maxsize,102 block=self._pool_block)103104 def init_poolmanager(self, connections, maxsize, block=DEFAULT_POOLBLOCK):105 """Initializes a urllib3 PoolManager. This method should not be called106 from user code, and is only exposed for use when subclassing the104 def init_poolmanager(self, connections, maxsize, block=DEFAULT_POOLBLOCK, **pool_kwargs):105 """Initializes a urllib3 PoolManager.106107 This method should not be called from user code, and is only108 exposed for use when subclassing the109 :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.110111 :param connections: The number of urllib3 connection pools to cache.112 :param maxsize: The maximum number of connections to save in the pool.113 :param block: Block when no free connections are available.114 :param pool_kwargs: Extra keyword arguments used to initialize the Pool Manager.115 """116 # save these values for pickling117 self._pool_connections = connections118 self._pool_maxsize = maxsize119 self._pool_block = block120121 self.poolmanager = PoolManager(num_pools=connections, maxsize=maxsize,119 block=block)122 block=block, **pool_kwargs)123124 def proxy_manager_for(self, proxy, **proxy_kwargs):125 """Return urllib3 ProxyManager for the given proxy.126
279 unmodified lines