diff options
-rw-r--r-- | mesonbuild/modules/python.py | 8 | ||||
-rw-r--r-- | test cases/python/1 basic/meson.build | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index 2dba007..693621b 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -131,7 +131,7 @@ class PythonDependency(ExternalDependency): if self.is_found: mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.green('YES ({})'.format(py_lookup_method))) else: - mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.red('NO')) + mlog.log('Dependency', mlog.bold(self.name), 'found:', [mlog.red('NO')]) def _find_libpy(self, python_holder, environment): if python_holder.is_pypy: @@ -512,8 +512,7 @@ class PythonModule(ExtensionModule): raise InvalidArguments('find_installation argument must be a string.') if not name_or_path: - mlog.log("Using meson's python {}".format(mesonlib.python_command)) - python = ExternalProgram('python3', mesonlib.python_command, silent=True) + python = ExternalProgram('python3', mesonlib.python_command) else: python = ExternalProgram.from_entry('python3', name_or_path) @@ -530,6 +529,9 @@ class PythonModule(ExtensionModule): if not python.found() and name_or_path in ['python2', 'python3']: python = ExternalProgram('python', silent=True) + mlog.log('Program', python.name, 'found:', + *[mlog.green('YES'), '({})'.format(' '.join(python.command))] if python.found() else [mlog.red('NO')]) + if not python.found(): if required: raise mesonlib.MesonException('{} not found'.format(name_or_path or 'python')) diff --git a/test cases/python/1 basic/meson.build b/test cases/python/1 basic/meson.build index f9a7433..9c3af10 100644 --- a/test cases/python/1 basic/meson.build +++ b/test cases/python/1 basic/meson.build @@ -1,7 +1,7 @@ project('python sample', 'c') py_mod = import('python') -py = py_mod.find_installation() +py = py_mod.find_installation('python3') py_version = py.language_version() if py_version.version_compare('< 3.2') |