|
|
|
@ -284,7 +284,7 @@ class PythonExternalProgram(ExternalProgram): |
|
|
|
|
if ext_prog is None: |
|
|
|
|
super().__init__(name, command=command, silent=True) |
|
|
|
|
else: |
|
|
|
|
self.name = ext_prog.name |
|
|
|
|
self.name = name |
|
|
|
|
self.command = ext_prog.command |
|
|
|
|
self.path = ext_prog.path |
|
|
|
|
self.info: T.Dict[str, str] = {} |
|
|
|
@ -515,13 +515,15 @@ class PythonModule(ExtensionModule): |
|
|
|
|
want_modules = mesonlib.extract_as_list(kwargs, 'modules') # type: T.List[str] |
|
|
|
|
found_modules = [] # type: T.List[str] |
|
|
|
|
missing_modules = [] # type: T.List[str] |
|
|
|
|
fallback = args[0] if args else '' |
|
|
|
|
display_name = fallback or 'python' |
|
|
|
|
|
|
|
|
|
if len(args) > 1: |
|
|
|
|
raise InvalidArguments('find_installation takes zero or one positional argument.') |
|
|
|
|
|
|
|
|
|
name_or_path = state.environment.lookup_binary_entry(MachineChoice.HOST, 'python') |
|
|
|
|
if name_or_path is None and args: |
|
|
|
|
name_or_path = args[0] |
|
|
|
|
name_or_path = fallback |
|
|
|
|
if not isinstance(name_or_path, str): |
|
|
|
|
raise InvalidArguments('find_installation argument must be a string.') |
|
|
|
|
|
|
|
|
@ -532,8 +534,8 @@ class PythonModule(ExtensionModule): |
|
|
|
|
if not name_or_path: |
|
|
|
|
python = PythonExternalProgram('python3', mesonlib.python_command) |
|
|
|
|
else: |
|
|
|
|
tmp_python = ExternalProgram.from_entry('python3', name_or_path) |
|
|
|
|
python = PythonExternalProgram('python3', ext_prog=tmp_python) |
|
|
|
|
tmp_python = ExternalProgram.from_entry(display_name, name_or_path) |
|
|
|
|
python = PythonExternalProgram(display_name, ext_prog=tmp_python) |
|
|
|
|
|
|
|
|
|
if not python.found() and mesonlib.is_windows(): |
|
|
|
|
pythonpath = self._get_win_pythonpath(name_or_path) |
|
|
|
|