launcher.py 文件源码

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

项目:python-embedded-launcher 作者: zsquareplusc 项目源码 文件源码
def wait_on_error():
    """\
    Wait on exception, but only if console window was opened separately.
    """
    if not is_separate_console_window():
        return

    import msvcrt
    import traceback

    def handle_exception(exctype, value, tb):  # pylint: disable=invalid-name
        """Print an exception and wait for a key"""
        traceback.print_exception(exctype, value, tb)
        sys.stderr.flush()
        sys.stdout.write('\n[Press any key]\n')
        sys.stdout.flush()
        msvcrt.getch()

    sys.excepthook = handle_exception
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号