distribute_setup.py 文件源码

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

项目:chip-python-aREST 作者: xtacocorex 项目源码 文件源码
def _under_prefix(location):
    if 'install' not in sys.argv:
        return True
    args = sys.argv[sys.argv.index('install') + 1:]
    for index, arg in enumerate(args):
        for option in ('--root', '--prefix'):
            if arg.startswith('%s=' % option):
                top_dir = arg.split('root=')[-1]
                return location.startswith(top_dir)
            elif arg == option:
                if len(args) > index:
                    top_dir = args[index + 1]
                    return location.startswith(top_dir)
        if arg == '--user' and USER_SITE is not None:
            return location.startswith(USER_SITE)
    return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号