def install_opener():
if 'http_proxy' in os.environ or 'https_proxy' in os.environ:
raise RuntimeError(
'http_proxy or https_proxy set in environment, please unset')
handlers = [WSGI_HTTPHandler()]
if WSGI_HTTPSHandler is not None:
handlers.append(WSGI_HTTPSHandler())
opener = url_lib.build_opener(*handlers)
url_lib.install_opener(opener)
return opener
urllib_intercept.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录