xml.py 文件源码

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

项目:diffoscope 作者: ReproducibleBuilds 项目源码 文件源码
def recognizes(cls, file):
        """
        Identifies if a given file has XML extension

        Args:
            file - a diffoscope.comparators.utils.file.File object

        Returns:
            False if file is not a XML File, True otherwise
        """
        if not super().recognizes(file):
            return False

        with open(file.path) as f:
            try:
                file.parsed = _parse(f)
            except (ExpatError, UnicodeDecodeError) as e:
                return False

        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号