excepthook.py 文件源码

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

项目:globus-cli 作者: globus 项目源码 文件源码
def exit_with_mapped_status(http_status):
    """
    Given an HTTP Status, exit with either an error status of 1 or the
    status mapped by what we were given.
    """
    # get the mapping by looking up the state and getting the mapping attr
    mapping = (click.get_current_context().ensure_object(CommandState)
               .http_status_map)

    # if there is a mapped exit code, exit with that. Otherwise, exit 1
    if http_status in mapping:
        sys.exit(mapping[http_status])
    else:
        sys.exit(1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号