]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
PY3: decode bytes in py3 where strings are needed
authorNoel Power <noel.power@suse.com>
Fri, 27 Jul 2018 15:54:16 +0000 (16:54 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 26 Sep 2018 23:54:27 +0000 (01:54 +0200)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/samba_conftests.py
buildtools/wafsamba/samba_perl.py
buildtools/wafsamba/samba_version.py

index 4981ff55637049a7802f4c28a44df8bb353a046c..d8f793638f5d56794460d45dd1b9ac1040970ea9 100644 (file)
@@ -508,7 +508,7 @@ def CHECK_STANDARD_LIBPATH(conf):
     # at least gcc and clang support this:
     try:
         cmd = conf.env.CC + ['-print-search-dirs']
-        out = Utils.cmd_output(cmd).split('\n')
+        out = Utils.cmd_output(cmd).decode('utf8').split('\n')
     except ValueError:
         # option not supported by compiler - use a standard list of directories
         dirlist = [ '/usr/lib', '/usr/lib64' ]
index eca72d65790bba13ccd98e06ef15abfa5ed8672f..3d4fe29027f7d6706f810fc303b2e4c6f521aa34 100644 (file)
@@ -15,7 +15,10 @@ def SAMBA_CHECK_PERL(conf, mandatory=True, version=(5,0,0)):
     conf.check_perl_version(version)
 
     def read_perl_config_var(cmd):
-        return Utils.to_list(Utils.cmd_output([conf.env.get_flat('PERL'), '-MConfig', '-e', cmd]))
+        output = Utils.cmd_output([conf.env.get_flat('PERL'), '-MConfig', '-e', cmd])
+        if not isinstance(output, str):
+            output = output.decode('utf8')
+        return Utils.to_list(output)
 
     def check_perl_config_var(var):
         conf.start_msg("Checking for perl $Config{%s}:" % var)
index 239f2445503a2923fa2f141c6339808f5fe46ef6..a5ad810321555a4f93c76ba3cc3dcc3658206fbe 100644 (file)
@@ -14,7 +14,7 @@ def git_version_summary(path, env=None):
     environ = dict(os.environ)
     environ["GIT_DIR"] = '%s/.git' % path
     environ["GIT_WORK_TREE"] = path
-    git = Utils.cmd_output(env.GIT + ' show --pretty=format:"%h%n%ct%n%H%n%cd" --stat HEAD', silent=True, env=environ)
+    git = Utils.cmd_output(env.GIT + ' show --pretty=format:"%h%n%ct%n%H%n%cd" --stat HEAD', silent=True, env=environ).decode('utf8')
 
     lines = git.splitlines()
     if not lines or len(lines) < 4: