fix python.version() not working in some cases

import('python').find_installation('python').version() causes exception
because of a missing initialization, when `find_installation()` receives
a name or a path.
This commit is contained in:
Charles Brunet
2023-04-19 07:56:42 -04:00
committed by Eli Schwartz
parent 01420bf8fc
commit bda799dff2
2 changed files with 4 additions and 0 deletions

View File

@@ -8,6 +8,9 @@ if py_version.version_compare('< 3.2')
error('MESON_SKIP_TEST python 3 required for tests')
endif
py_full_version = py.version()
message(f'Using python version: @py_full_version@')
py_purelib = py.get_path('purelib')
if not (py_purelib.endswith('site-packages') or py_purelib.endswith('dist-packages'))
error('Python3 purelib path seems invalid? ' + py_purelib)