Get a list of the executables of all ancestor processes.

def get_ancestor_processes():
    """Get a list of the executables of all ancestor processes."""
    if not _ANCESTOR_PROCESSES and psutil is not None:
        proc = psutil.Process(os.getpid())
        while proc.parent() is not None:
            try:
                _ANCESTOR_PROCESSES.append(proc.parent().exe())
                proc = proc.parent()
            except psutil.Error:
                break
    return _ANCESTOR_PROCESSES