mx.py 文件源码

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

项目:mx 作者: graalvm 项目源码 文件源码
def _parse_http_proxy(envVarNames):
    """
    Parses the value of the first existing environment variable named
    in `envVarNames` into a host and port tuple where port is None if
    it's not present in the environment variable.
    """
    p = re.compile(r'(?:https?://)?([^:]+):?(\d+)?/?$')
    for name in envVarNames:
        value = get_env(name)
        if value:
            m = p.match(value)
            if m:
                return m.group(1), m.group(2)
            else:
                abort("Value of " + name + " is not valid:  " + value)
    return (None, None)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号