fypp.py 文件源码

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

项目:fypp 作者: aradi 项目源码 文件源码
def _handle_assert(self, fname, span, expr):
        result = ''
        try:
            cond = bool(self._evaluate(expr, fname, span[0]))
        except Exception as exc:
            msg = "exception occured when evaluating assert condition '{0}'"\
                .format(expr)
            raise FyppFatalError(msg, fname, span, exc)
        if not cond:
            msg = "Assertion failed ('{0}')".format(expr)
            raise FyppStopRequest(msg, fname, span)
        if self._linenums and not self._diverted:
            result = linenumdir(span[1], fname)
        return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号