def _warning_on_one_line(message, category, filename, lineno, file=None,
                         line=None):
    """Formats warning messages to appear on one line."""
    return '%s:%s: %s: %s\n' % (filename, lineno, category.__name__, message)