Kaydet (Commit) d9f1b250 authored tarafından Joffrey F's avatar Joffrey F

Simplified init_poolmanager

üst ff8c9bb5
...@@ -21,13 +21,13 @@ class SSLAdapter(HTTPAdapter): ...@@ -21,13 +21,13 @@ class SSLAdapter(HTTPAdapter):
def init_poolmanager(self, connections, maxsize, block=False): def init_poolmanager(self, connections, maxsize, block=False):
urllib_ver = urllib3.__version__.split('-')[0] urllib_ver = urllib3.__version__.split('-')[0]
if urllib3 and urllib_ver != 'dev' and \ kwargs = {
StrictVersion(urllib_ver) <= StrictVersion('1.5'): 'num_pools': connections,
self.poolmanager = PoolManager(num_pools=connections, 'maxsize': maxsize,
maxsize=maxsize, 'block': block
block=block) }
else: if urllib3 and urllib_ver == 'dev' and \
self.poolmanager = PoolManager(num_pools=connections, StrictVersion(urllib_ver) > StrictVersion('1.5'):
maxsize=maxsize, kwargs['ssl_version'] = self.ssl_version
block=block,
ssl_version=self.ssl_version) self.poolmanager = PoolManager(**kwargs)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment