cmdline.py 文件源码

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

项目:flasky 作者: RoseOu 项目源码 文件源码
def main(argv=None):
    """The main entry point to Coverage.

    This is installed as the script entry point.

    """
    if argv is None:
        argv = sys.argv[1:]
    try:
        start = time.clock()
        status = CoverageScript().command_line(argv)
        end = time.clock()
        if 0:
            print("time: %.3fs" % (end - start))
    except ExceptionDuringRun:
        # An exception was caught while running the product code.  The
        # sys.exc_info() return tuple is packed into an ExceptionDuringRun
        # exception.
        _, err, _ = sys.exc_info()
        traceback.print_exception(*err.args)
        status = ERR
    except CoverageException:
        # A controlled error inside coverage.py: print the message to the user.
        _, err, _ = sys.exc_info()
        print(err)
        status = ERR
    except SystemExit:
        # The user called `sys.exit()`.  Exit with their argument, if any.
        _, err, _ = sys.exc_info()
        if err.args:
            status = err.args[0]
        else:
            status = None
    return status
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号