def is_tty(file):
    """ Calls file.isatty() if available. If it's not available, returns False.
    """
    try:
        istty = file.isatty()
    except AttributeError:
        return False
    return istty