Python urllib.request 模块,FancyURLopener() 实例源码

我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用urllib.request.FancyURLopener()

项目:packaging    作者:blockstack    | 项目源码 | 文件源码
def urlopen(url, data=None, proxies=None):
    """urlopen(url [, data]) -> open file-like object"""
    global _urlopener
    if proxies is not None:
        opener = urllib_request.FancyURLopener(proxies=proxies)
    elif not _urlopener:
        with support.check_warnings(
                ('FancyURLopener style of invoking requests is deprecated.',
                DeprecationWarning)):
            opener = urllib_request.FancyURLopener()
        _urlopener = opener
    else:
        opener = _urlopener
    if data is None:
        return opener.open(url)
    else:
        return opener.open(url, data)
项目:pisap    作者:neurospin    | 项目源码 | 文件源码
def __init__(self):
        super(FancyURLopener, self).__init__()