buildtools/wafsamba: Ensure default python picked up is python3
authorAndrew Bartlett <abartlet@samba.org>
Thu, 13 Dec 2018 17:03:13 +0000 (17:03 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 13 Dec 2018 23:51:33 +0000 (00:51 +0100)
1) set the default python searched for samba waf to be python3
2) remove default setting of PYTHON variable if not defined (not needed)

Signed-off-by: Noel Power <npower@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/samba_python.py

index dd602451cfa2cd2156e8e431cf8ecb44d80d52cd..fac0e34b3f16b6edb93ee1227efaebc041dec7e6 100644 (file)
@@ -29,12 +29,9 @@ def SAMBA_CHECK_PYTHON(conf, mandatory=True, version=(2,6,0)):
         interpreters.append(conf.env['PYTHON'])
         conf.setenv('default')
 
-    if not os.getenv('PYTHON', None):
-        conf.env['PYTHON'] = 'python3'
-
-    conf.find_program('python', var='PYTHON', mandatory=mandatory)
+    conf.find_program('python3', var='PYTHON', mandatory=mandatory)
     conf.load('python')
-    path_python = conf.find_program('python')
+    path_python = conf.find_program('python3')
 
     conf.env.PYTHON_SPECIFIED = (conf.env.PYTHON != path_python)
     conf.check_python_version(version)