From 3c83519bb0c7b5c7fc55e9f00ccbfbd326857c86 Mon Sep 17 00:00:00 2001
From: Hadrien Grasland <grasland@lal.in2p3.fr>
Date: Wed, 14 Feb 2018 18:21:46 +0100
Subject: [PATCH] Adding more from apearce/apearce-python3 to fix some broken
 tests, not complete yet

---
 cmake/EnvConfig/TestEnvOps.py  | 3 ++-
 cmake/tests/test_LBCORE_716.py | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/cmake/EnvConfig/TestEnvOps.py b/cmake/EnvConfig/TestEnvOps.py
index b615ef65f..232a819a4 100644
--- a/cmake/EnvConfig/TestEnvOps.py
+++ b/cmake/EnvConfig/TestEnvOps.py
@@ -3,6 +3,7 @@ Created on Jul 12, 2011
 
 @author: mplajner
 '''
+from __future__ import print_function
 import unittest
 import os
 import sys
@@ -124,7 +125,7 @@ class TemporaryDir(object):
         if not self.keep:
             self.remove()
         else:
-            print "WARNING: not removing temporary directory", self.path
+            print("WARNING: not removing temporary directory", self.path)
         return False
 
 
diff --git a/cmake/tests/test_LBCORE_716.py b/cmake/tests/test_LBCORE_716.py
index cd891691e..15c1c6d7a 100644
--- a/cmake/tests/test_LBCORE_716.py
+++ b/cmake/tests/test_LBCORE_716.py
@@ -27,6 +27,7 @@ def build():
     build_proc = Popen(['make', 'VERBOSE=1'], cwd=base_dir,
                        stdout=PIPE, stderr=PIPE)
     build_log, build_err = build_proc.communicate()
+    build_log, build_err = build_log.decode('utf-8'), build_err.decode('utf-8')
     build_returncode = build_proc.returncode
 
 
@@ -59,7 +60,8 @@ def test_env():
     getenv = Popen([xenv_cmd, '--xml', envfile,
                     'printenv', 'ROOT_INCLUDE_PATH'],
                    stdout=PIPE, stderr=PIPE)
-    out, _err = getenv.communicate()
+    out, _ = getenv.communicate()
+    out = out.decode('utf-8')
     assert getenv.returncode == 0, getenv.returncode
 
     root_inc_path = [os.path.relpath(l, base_dir)[0]
-- 
GitLab