(message, category, filename, lineno, line=None)
return s
Function to format a warning the standard way.
Function to format a warning the standard way.
Function to format a warning the standard way .
def formatwarning(message, category, filename, lineno, line=None):
    """Function to format a warning the standard way."""
    s =  "%s:%s: %s: %s\n" % (filename, lineno, category.__name__, message)
    line = linecache.getline(filename, lineno) if line is None else line
    if line:
        line = line.strip()
        s += "  %s\n" % line
    return s
def formatwarning ( message , category , filename , lineno , line = None ) : s = "%s:%s: %s: %s\n" % ( filename , lineno , category . __name__ , message ) line = linecache . getline ( filename , lineno ) if line is None else line if line : line = line . strip ( ) s += "  %s\n" % line return s