regionservice.py 文件源码

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

项目:maas 作者: maas 项目源码 文件源码
def isLoopbackURL(url):
    """Checks if the specified URL refers to a loopback address.

    :return: True if the URL refers to the loopback interface, otherwise False.
    """
    if url is not None:
        if url.hostname is not None:
            is_loopback = yield deferToThread(
                resolves_to_loopback_address, url.hostname)
        else:
            # Empty URL == localhost.
            is_loopback = True
    else:
        # We need to pass is_loopback in, but it is only checked if url
        # is not None.  None is the "I don't know and you won't ask"
        # state for this boolean.
        is_loopback = None
    return is_loopback
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号