PyShell.py 文件源码

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

项目:oil 作者: oilshell 项目源码 文件源码
def idle_showwarning(
        message, category, filename, lineno, file=None, line=None):
    """Show Idle-format warning (after replacing warnings.showwarning).

    The differences are the formatter called, the file=None replacement,
    which can be None, the capture of the consequence AttributeError,
    and the output of a hard-coded prompt.
    """
    if file is None:
        file = warning_stream
    try:
        file.write(idle_formatwarning(
                message, category, filename, lineno, line=line))
        file.write(">>> ")
    except (AttributeError, IOError):
        pass  # if file (probably __stderr__) is invalid, skip warning.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号