summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2018-11-29 15:12:10 +0000
committerNoel Power <npower@samba.org>2018-12-10 10:38:25 +0100
commit19ac50ba2d7d193816c79d44e472e8cf4acb8aeb (patch)
tree41af617120e1f88c5c359bf0654b72f628e31f7e /buildtools/wafsamba
parentf4c0343dc4288e9cd00d7325633949020c3d300b (diff)
downloadsamba-19ac50ba2d7d193816c79d44e472e8cf4acb8aeb.tar.gz
buildtools/wafsamba: Ensure we detect the correct python.
In order to support a default python3 build we need to ensure we detect python3 if no PYTHON env variable is set up. Currently we detect python with conf.find_program('python', var='PYTHON', mandatory=mandatory) which uses PYTHON as as hint and falls back to the program name 'python' otherwise Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'buildtools/wafsamba')
-rw-r--r--buildtools/wafsamba/samba_python.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py
index bca863bea87..7879a1abd86 100644
--- a/buildtools/wafsamba/samba_python.py
+++ b/buildtools/wafsamba/samba_python.py
@@ -1,6 +1,6 @@
# waf build tool for building IDL files with pidl
-import os
+import os, sys
from waflib import Build, Logs, Utils, Configure, Errors
from waflib.Configure import conf
@@ -28,6 +28,8 @@ def SAMBA_CHECK_PYTHON(conf, mandatory=True, version=(2,4,2)):
interpreters.append(conf.env['PYTHON'])
conf.setenv('default')
+ if not os.getenv('PYTHON', None):
+ conf.env['PYTHON'] = sys.executable
conf.find_program('python', var='PYTHON', mandatory=mandatory)
conf.load('python')
path_python = conf.find_program('python')