aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/python.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2018-09-18 15:17:31 -0700
committerDylan Baker <dylan@pnwbakers.com>2018-11-14 15:57:37 -0800
commit71a5f990d09f04d8eb8d636abf7e2b446fdf826a (patch)
treec9b4b3d5f45df4ff9340c26c35a909aef19bd424 /mesonbuild/modules/python.py
parent091452f8cd886dedc2bc5d3ec292dcf899989a24 (diff)
downloadmeson-71a5f990d09f04d8eb8d636abf7e2b446fdf826a.zip
meson-71a5f990d09f04d8eb8d636abf7e2b446fdf826a.tar.gz
meson-71a5f990d09f04d8eb8d636abf7e2b446fdf826a.tar.bz2
modules/python: Allow use of the native file
Currently this just allows setting a "python" variable that always overrides, probably we want to have the option for "python2" and "python3" as well.
Diffstat (limited to 'mesonbuild/modules/python.py')
-rw-r--r--mesonbuild/modules/python.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
index 954220b..3b2bf07 100644
--- a/mesonbuild/modules/python.py
+++ b/mesonbuild/modules/python.py
@@ -480,7 +480,9 @@ class PythonModule(ExtensionModule):
if len(args) > 1:
raise InvalidArguments('find_installation takes zero or one positional argument.')
- if args:
+ if 'python' in state.environment.config_info.binaries:
+ name_or_path = state.environment.config_info.binaries['python']
+ elif args:
name_or_path = args[0]
if not isinstance(name_or_path, str):
raise InvalidArguments('find_installation argument must be a string.')