def __https_pool(self):
"""
Create HTTP connection pool
:raise HttpsRequestError
:return: urllib3.HTTPConnectionPool
"""
try:
pool = HTTPSConnectionPool(
host=self.__cfg.host,
port=self.__cfg.port,
maxsize=self.__cfg.threads,
timeout=Timeout(self.__cfg.timeout, read=self.__cfg.timeout),
block=True)
if self._HTTP_DBG_LEVEL <= self.__debug.level:
self.__debug.debug_connection_pool('https_pool_start', pool)
return pool
except Exception as error:
raise HttpsRequestError(str(error))
评论列表
文章目录