def is_tarfile(name):
    """Return True if name points to a tar archive that we
       are able to handle, else return False.
    """
    try:
        t = open(name)
        t.close()
        return True
    except TarError:
        return False
Return True if name points to a tar archive that we
       are able to handle, else return False.
    
product/gradle-plugin/src/main/python/pip/_vendor/distlib/_backport/tarfile.py