Skip to content

Commit d9f1b25

Browse files
committed
Simplified init_poolmanager
1 parent ff8c9bb commit d9f1b25

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docker/ssladapter/ssladapter.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ def __init__(self, ssl_version=None, **kwargs):
2121

2222
def init_poolmanager(self, connections, maxsize, block=False):
2323
urllib_ver = urllib3.__version__.split('-')[0]
24-
if urllib3 and urllib_ver != 'dev' and \
25-
StrictVersion(urllib_ver) <= StrictVersion('1.5'):
26-
self.poolmanager = PoolManager(num_pools=connections,
27-
maxsize=maxsize,
28-
block=block)
29-
else:
30-
self.poolmanager = PoolManager(num_pools=connections,
31-
maxsize=maxsize,
32-
block=block,
33-
ssl_version=self.ssl_version)
24+
kwargs = {
25+
'num_pools': connections,
26+
'maxsize': maxsize,
27+
'block': block
28+
}
29+
if urllib3 and urllib_ver == 'dev' and \
30+
StrictVersion(urllib_ver) > StrictVersion('1.5'):
31+
kwargs['ssl_version'] = self.ssl_version
32+
33+
self.poolmanager = PoolManager(**kwargs)

0 commit comments

Comments
 (0)