(self, name: str, search_dir: T.Optional[str])
return [command]
Search in the specified dir for the specified executable by name
        and if not found search in PATH
Search in the specified dir for the specified executable by name
        and if not found search in PATH
Search in the specified dir for the specified executable by name and if not found search in PATH
def _search(self, name: str, search_dir: T.Optional[str]) -> T.List[T.Optional[str]]:
        '''
        Search in the specified dir for the specified executable by name
        and if not found search in PATH
        '''
        commands = self._search_dir(name, search_dir)
        if commands:
            return commands
        # If there is a directory component, do not look in PATH
        if os.path.dirname(name) and not os.path.isabs(name):
            return [None]
        # Do a standard search in PATH
        path = os.environ.get('PATH', None)
        if mesonlib.is_windows() and path:
            path = self._windows_sanitize_path(path)
        command = shutil.which(name, path=path)
        if mesonlib.is_windows():
            return self._search_windows_special_cases(name, command)
        # On UNIX-like platforms, shutil.which() is enough to find
        # all executables whether in PATH or with an absolute path
        return [command]
def _search ( self , name : str , search_dir : T . Optional [ str ] ) -> T . List [ T . Optional [ str ] ] : commands = self . _search_dir ( name , search_dir ) if commands : return commands # If there is a directory component, do not look in PATH if os . path . dirname ( name ) and not os . path . isabs ( name ) : return [ None ] # Do a standard search in PATH path = os . environ . get ( 'PATH' , None ) if mesonlib . is_windows ( ) and path : path = self . _windows_sanitize_path ( path ) command = shutil . which ( name , path = path ) if mesonlib . is_windows ( ) : return self . _search_windows_special_cases ( name , command ) # On UNIX-like platforms, shutil.which() is enough to find # all executables whether in PATH or with an absolute path return [ command ]