buildtools/wafsamba: Support --extra-python with python2
authorNoel Power <noel.power@suse.com>
Thu, 29 Nov 2018 16:51:50 +0000 (16:51 +0000)
committerNoel Power <npower@samba.org>
Mon, 10 Dec 2018 09:38:25 +0000 (10:38 +0100)
Relax restriction on extra_python version

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

index 7879a1abd8672d46fbba56632ba70f461ba5604a..419c559848f6bf8009feb15f0fcbc289677226ef 100644 (file)
@@ -5,7 +5,7 @@ from waflib import Build, Logs, Utils, Configure, Errors
 from waflib.Configure import conf
 
 @conf
-def SAMBA_CHECK_PYTHON(conf, mandatory=True, version=(2,4,2)):
+def SAMBA_CHECK_PYTHON(conf, mandatory=True, version=(2,6,0)):
     # enable tool to build python extensions
     if conf.env.HAVE_PYTHON_H:
         conf.check_python_version(version)
@@ -21,9 +21,10 @@ def SAMBA_CHECK_PYTHON(conf, mandatory=True, version=(2,4,2)):
         conf.find_program('python', var='PYTHON', mandatory=True)
         conf.load('python')
         try:
-            conf.check_python_version((3, 3, 0))
+            conf.check_python_version(version)
         except Exception:
-            Logs.warn('extra-python needs to be Python 3.3 or later')
+            Logs.warn('extra-python needs to be Python %s.%s.%s or later' %
+                      (version[0], version[1], version[2]))
             raise
         interpreters.append(conf.env['PYTHON'])
         conf.setenv('default')