diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2021-10-28 15:06:27 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2023-06-01 18:47:03 -0400 |
commit | 26da7ec9f535205f9a6b102380087a1383c092c3 (patch) | |
tree | d3b24c6f737b1c063af390d3d05ff9ae917c89ea /mesonbuild/modules | |
parent | 1a9f20d44a3c88882e5744d6179926f3f179cc8d (diff) | |
download | meson-26da7ec9f535205f9a6b102380087a1383c092c3.zip meson-26da7ec9f535205f9a6b102380087a1383c092c3.tar.gz meson-26da7ec9f535205f9a6b102380087a1383c092c3.tar.bz2 |
python: Use detect.find_external_dependency() for log consistency
py.find_installation().dependency() was not logging whether it is found
or not. Use find_external_dependency() for consistency.
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r-- | mesonbuild/modules/python.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index 8588c4c..ac74e13 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -22,7 +22,7 @@ from .. import mlog from ..coredata import UserFeatureOption from ..build import known_shmod_kwargs from ..dependencies import NotFoundDependency -from ..dependencies.detect import get_dep_identifier +from ..dependencies.detect import get_dep_identifier, find_external_dependency from ..dependencies.python import BasicPythonExternalProgram, python_factory, _PythonDependencyBase from ..interpreter import ExternalProgramHolder, extract_required_kwarg, permitted_dependency_kwargs from ..interpreter import primitives as P_OBJ @@ -185,12 +185,8 @@ class PythonInstallation(ExternalProgramHolder): new_kwargs = kwargs.copy() new_kwargs['required'] = False - # it's theoretically (though not practically) possible to not bind dep, let's ensure it is. - dep: Dependency = NotFoundDependency('python', self.interpreter.environment) - for d in python_factory(self.interpreter.environment, for_machine, new_kwargs, self.held_object): - dep = d() - if dep.found(): - break + candidates = python_factory(self.interpreter.environment, for_machine, new_kwargs, self.held_object) + dep = find_external_dependency('python', self.interpreter.environment, new_kwargs, candidates) self.interpreter.coredata.deps[for_machine].put(identifier, dep) return dep |