(message, category, filename, lineno, line=None)
return s
Format warnings the IDLE way.
Format warnings the IDLE way.
Format warnings the IDLE way .
def idle_formatwarning(message, category, filename, lineno, line=None):
    """Format warnings the IDLE way."""

    s = "\nWarning (from warnings module):\n"
    s += '  File \"%s\", line %s\n' % (filename, lineno)
    if line is None:
        line = linecache.getline(filename, lineno)
    line = line.strip()
    if line:
        s += "    %s\n" % line
    s += "%s: %s\n" % (category.__name__, message)
    return s
def idle_formatwarning ( message , category , filename , lineno , line = None ) : s = "\nWarning (from warnings module):\n" s += '  File \"%s\", line %s\n' % ( filename , lineno ) if line is None : line = linecache . getline ( filename , lineno ) line = line . strip ( ) if line : s += "    %s\n" % line s += "%s: %s\n" % ( category . __name__ , message ) return s