aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/python.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-01-05 21:44:31 +0200
committerGitHub <noreply@github.com>2019-01-05 21:44:31 +0200
commit1aca899a63ef287c6fb06e5383f6355b5e75d6d2 (patch)
treec0a77585ae3dbb716b5b51557486ffc25ef4dadf /mesonbuild/modules/python.py
parent26437f0297bd9dcf4411d4591679724d59e1c312 (diff)
parente147054d6f8b78b306125fd785603ca0519fdfc1 (diff)
downloadmeson-1aca899a63ef287c6fb06e5383f6355b5e75d6d2.zip
meson-1aca899a63ef287c6fb06e5383f6355b5e75d6d2.tar.gz
meson-1aca899a63ef287c6fb06e5383f6355b5e75d6d2.tar.bz2
Merge pull request #4445 from Ericson2314/no-cross_info
Parsing of cross file upfront, and store in cross-agnostic data structures
Diffstat (limited to 'mesonbuild/modules/python.py')
-rw-r--r--mesonbuild/modules/python.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
index 9643ebc..c14ac85 100644
--- a/mesonbuild/modules/python.py
+++ b/mesonbuild/modules/python.py
@@ -501,20 +501,17 @@ class PythonModule(ExtensionModule):
if len(args) > 1:
raise InvalidArguments('find_installation takes zero or one positional argument.')
- if 'python' in state.environment.config_info.binaries:
- name_or_path = state.environment.config_info.binaries['python']
- elif args:
+ name_or_path = state.environment.binaries.host.lookup_entry('python')
+ if name_or_path is None and args:
name_or_path = args[0]
if not isinstance(name_or_path, str):
raise InvalidArguments('find_installation argument must be a string.')
- else:
- name_or_path = None
if not name_or_path:
mlog.log("Using meson's python {}".format(mesonlib.python_command))
python = ExternalProgram('python3', mesonlib.python_command, silent=True)
else:
- python = ExternalProgram(name_or_path, silent = True)
+ python = ExternalProgram.from_entry('python3', name_or_path)
if not python.found() and mesonlib.is_windows():
pythonpath = self._get_win_pythonpath(name_or_path)