def _find_source_script(self, prog: T.Union[(str, ExecutableHolder)], args):
    if isinstance(prog, ExecutableHolder):
        prog_path = self.interpreter.backend.get_target_filename(prog.held_object)
        return build.RunScript([prog_path], args)
    elif isinstance(prog, ExternalProgramHolder):
        return build.RunScript(prog.get_command(), args)
    search_dir = os.path.join(self.interpreter.environment.source_dir, self.interpreter.subdir)
    key = (prog, search_dir)
    if (key in self._found_source_scripts):
        found = self._found_source_scripts[key]
    else:
        found = dependencies.ExternalProgram(prog, search_dir=search_dir)
        if found.found():
            self._found_source_scripts[key] = found
        else:
            m = 'Script or command {!r} not found or not executable'
            raise InterpreterException(m.format(prog))
    return build.RunScript(found.get_command(), args)
def _find_source_script(self, prog: T.Union[(str, ExecutableHolder)], args):
    if isinstance(prog, ExecutableHolder):
        prog_path = self.interpreter.backend.get_target_filename(prog.held_object)
        return build.RunScript([prog_path], args)
    elif isinstance(prog, ExternalProgramHolder):
        return build.RunScript(prog.get_command(), args)
    search_dir = os.path.join(self.interpreter.environment.source_dir, self.interpreter.subdir)
    key = (prog, search_dir)
    if (key in self._found_source_scripts):
        found = self._found_source_scripts[key]
    else:
        found = dependencies.ExternalProgram(prog, search_dir=search_dir)
        if found.found():
            self._found_source_scripts[key] = found
        else:
            m = 'Script or command {!r} not found or not executable'
            raise InterpreterException(m.format(prog))
    return build.RunScript(found.get_command(), args)