summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <freddy77@gmail.com>2021-10-28 16:45:34 +0100
committerFrediano Ziglio <freddy77@gmail.com>2021-10-28 16:46:38 +0100
commita7b5474bf808934cf0ee1107a58d5f4d97b9afbf (patch)
tree6dc317de5b328d037b770740d2be2bd175105018
parent96dd7873777583820a19c8261f5adb5807960c4d (diff)
build: Correctly check for Python modules
Currently using Meson the command "python -m <MODULE_NAME>" is run. However this command instead of trying to import the module tried to execute it as a script failing for the updated pyparsing with: /usr/bin/python3: No module named pyparsing.__main__; 'pyparsing' is a package and cannot be directly executed So instead use "python -c 'import <MODULE_NAME>". Autoconf is already using that command (see m4/ax_python_module.m4). Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
-rw-r--r--meson.build2
1 files changed, 1 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index aff6243..eeccecd 100644
--- a/meson.build
+++ b/meson.build
@@ -132,7 +132,7 @@ if spice_common_generate_client_code or spice_common_generate_server_code
if get_option('python-checks')
foreach module : ['six', 'pyparsing']
message('Checking for python module @0@'.format(module))
- cmd = run_command(python, '-m', module)
+ cmd = run_command(python, '-c', 'import @0@'.format(module))
if cmd.returncode() != 0
error('Python module @0@ not found'.format(module))
endif