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 dd60245..fac0e34 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)