mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2026-01-05 06:37:29 +00:00
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>
This commit is contained in:
parent
96dd787377
commit
a7b5474bf8
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user