trex_stl_exceptions.py 文件源码

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

项目:trex-http-proxy 作者: alwye 项目源码 文件源码
def __str__ (self):
        exc_type, exc_obj, exc_tb = sys.exc_info()
        if not exc_tb:
            return self.msg
        fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]


        src_line = str(linecache.getline(fname, exc_tb.tb_lineno))


        s = "\n******\n"
        s += "Error at {0}:{1} - '{2}'\n\n".format(format_text(fname, 'bold'), format_text(exc_tb.tb_lineno, 'bold'), format_text(src_line.strip(), 'bold'))
        s += "specific error:\n\n{0}\n".format(format_text(self.msg, 'bold'))



        return s
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号