'Internal: turn a program name into a file name, using $PATH,
make sure it exists / is executable, raising a ProcessException
if not'

def get_execv_args(self):

    try:
        commandargs = shlex.split(self.config.command)
    except ValueError as e:
        raise BadCommand(("can't    parse    command    %r:    %s" % (self.config.command, str(e))))
    if commandargs:
        program = commandargs[0]
    else:
        raise BadCommand('command    is    empty')
    if ('/' in program):
        filename = program
        try:
            st = self.config.options.stat(filename)
        except OSError:
            st = None
    else:
        path = self.config.options.get_path()
        found = None
        st = None
        for dir in path:
            found = os.path.join(dir, program)
            try:
                st = self.config.options.stat(found)
            except OSError:
                pass
            else:
                break
        if (st is None):
            filename = program
        else:
            filename = found
    self.config.options.check_execv_args(filename, commandargs, st)
    return (filename, commandargs)
