cache.py 文件源码

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

项目:pip-update-requirements 作者: alanhamlett 项目源码 文件源码
def _get_candidates(self, link, package_name):
        can_not_cache = (
            not self.cache_dir or
            not package_name or
            not link
        )
        if can_not_cache:
            return []

        canonical_name = canonicalize_name(package_name)
        formats = index.fmt_ctl_formats(
            self.format_control, canonical_name
        )
        if not self.allowed_formats.intersection(formats):
            return []

        root = self.get_path_for_link(link)
        try:
            return os.listdir(root)
        except OSError as err:
            if err.errno in {errno.ENOENT, errno.ENOTDIR}:
                return []
            raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号