urllib_intercept.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:deb-python-wsgi-intercept 作者: openstack 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号