[PATCHv2 1-14/14] Re: Disabling Python Modules

Alexander Bokovoy ab at samba.org
Sun Jan 29 08:18:16 UTC 2017


On su, 29 tammi 2017, Ian Stakenvicius wrote:
> >> So as-is, would this patchset be complete or should I also include the
> >> code to remove --disable-python from the wscript of standalone modules?
> > Please add patches for the standalone modules too.
> > 
> 
> 
> I've integrated the suggested changes and finished adjustments to the
> standalone modules.  I also squashed the patchset a bit more.  Please
> find attached the patchset for review and approval.
> 
> As promised, I've also rebased Petr's multi-python work on top of this
> patchset, available for review at
> https://github.com/axs-gentoo/samba/tree/disable-python-v2-with-python3
> -- note that with this patchset there are only two conflicting lines
> between them that I had to compensate for.
> 
> (edit - re-sending without openpgp signature)
Thanks. This looks good except one small set of fixes for
samba_python.py to reduce pep8 errors (attached). If you would integrate
that in, I'm glad to do RB+.

We need one more team reviewer. Andrew?

-- 
/ Alexander Bokovoy
-------------- next part --------------
diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py
index 2e5b342..272b128 100644
--- a/buildtools/wafsamba/samba_python.py
+++ b/buildtools/wafsamba/samba_python.py
@@ -4,8 +4,9 @@ import os
 import Build, Logs, Utils, Configure
 from Configure import conf
 
+
 @conf
-def SAMBA_CHECK_PYTHON(conf, mandatory=True, version=(2,4,2)):
+def SAMBA_CHECK_PYTHON(conf, mandatory=True, version=(2, 4, 2)):
     # enable tool to build python extensions
     if conf.env.HAVE_PYTHON_H:
         conf.check_python_version(version)
@@ -42,7 +43,8 @@ def SAMBA_CHECK_PYTHON(conf, mandatory=True, version=(2,4,2)):
 def SAMBA_CHECK_PYTHON_HEADERS(conf, mandatory=True):
     if conf.env.disable_python:
         if mandatory:
-            raise Utils.WafError("Cannot check for python headers when --disable-python specified")
+            raise Utils.WafError("Cannot check for python headers when "
+                                 "--disable-python specified")
 
         conf.msg("python headers", "Check disabled due to --disable-python")
         return
@@ -70,13 +72,14 @@ def SAMBA_CHECK_PYTHON_HEADERS(conf, mandatory=True):
     del(conf.env.defines['PYTHONDIR'])
     del(conf.env.defines['PYTHONARCHDIR'])
 
+
 def _check_python_headers(conf, mandatory):
     try:
         Configure.ConfigurationError
         conf.check_python_headers(mandatory=mandatory)
     except Configure.ConfigurationError:
         if mandatory:
-             raise
+            raise
 
     if conf.env['PYTHON_VERSION'] > '3':
         abi_pattern = os.path.splitext(conf.env['pyext_PATTERN'])[0]


More information about the samba-technical mailing list