concurrency.py 文件源码

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

项目:easypy 作者: weka-io 项目源码 文件源码
def raise_in_main_thread(exception_type=Exception):

    try:
        yield
    except ProcessExiting:
        # this exception is meant to stay within the thread
        raise
    except exception_type as exc:
        if threading.current_thread() is threading.main_thread():
            raise
        exc._raised_asynchronously = True

        global LAST_ERROR
        if LAST_ERROR:
            _logger.warning("a different error (%s) is pending - skipping", type(LAST_ERROR))
            raise
        LAST_ERROR = exc
        _rimt(exc)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号