tidy.py 文件源码

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

项目:servoshell 作者: paulrouget 项目源码 文件源码
def check_json(filename, contents):
    if not filename.endswith(".json"):
        raise StopIteration

    try:
        json.loads(contents, object_pairs_hook=check_json_requirements(filename))
    except ValueError as e:
        match = re.search(r"line (\d+) ", e.message)
        line_no = match and match.group(1)
        yield (line_no, e.message)
    except KeyError as e:
        yield (None, e.message)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号