From 0bdc5b9e6c922b6dd4eede1a0cfaf413833b11ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Wilmet?= Date: Fri, 29 Jul 2022 19:53:23 +0200 Subject: build: fix a new meson warning With Meson 0.62, I get this warning: ``` Program python3 found: YES (/usr/bin/python3) WARNING: You should add the boolean check kwarg to the run_command call. It currently defaults to false, but it will default to true in future releases of meson. See also: https://github.com/mesonbuild/meson/issues/9300 ``` Here we print a custom error() message, so don't fail directly if the returncode is non-zero. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 5d03db6..dc13573 100644 --- a/meson.build +++ b/meson.build @@ -41,7 +41,7 @@ python3_required_modules = ['pygments'] foreach p : python3_required_modules # Source: https://docs.python.org/3/library/importlib.html#checking-if-a-module-can-be-imported script = 'import importlib.util; import sys; exit(1) if importlib.util.find_spec(\''+ p +'\') is None else exit(0)' - if run_command(python3, '-c', script).returncode() != 0 + if run_command(python3, '-c', script, check: false).returncode() != 0 error('Required Python3 module \'' + p + '\' not found') endif endforeach -- cgit v1.2.1