summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Traut <manut@linutronix.de>2017-09-20 08:26:35 +0200
committerManuel Traut <manut@linutronix.de>2017-09-20 08:26:35 +0200
commit1ffe2b3096b6f3d2d03f4eb8320a5727e49838f8 (patch)
tree93541a5af40e66fe8b01e336b9d25c979e8916ac
parent3b36049c75a0c67be830a6683cf57f17d0e348c2 (diff)
be more specific about bytes and strings
needed to run with python3 Signed-off-by: Manuel Traut <manut@linutronix.de>
-rwxr-xr-xpyjutest8
1 files changed, 5 insertions, 3 deletions
diff --git a/pyjutest b/pyjutest
index 49c71de..3bfd9e3 100755
--- a/pyjutest
+++ b/pyjutest
@@ -14,7 +14,7 @@ if len (sys.argv) != 2:
sys.exit(-1)
if os.path.exists('pyjutest.dat'):
- with open('pyjutest.dat', 'r') as dat:
+ with open('pyjutest.dat', 'rb') as dat:
tss = load(dat)
else:
tss = [TestSuite("suite", None)]
@@ -22,13 +22,15 @@ else:
p = Popen(sys.argv[1], shell=True, stdout=PIPE, stderr=PIPE)
out,err = p.communicate()
-tc = TestCase(sys.argv[1], 'sh', 2, out[:-1], err[:-1])
+tc = TestCase(sys.argv[1], 'sh', 2, out[:-1].decode('utf-8'),
+ err[:-1].decode('utf-8'))
+
if p.returncode:
tc.add_failure_info(err, "return: %d" % p.returncode)
tss[0].test_cases.append(tc)
-with open('pyjutest.dat', 'w') as dat:
+with open('pyjutest.dat', 'wb') as dat:
dump(tss, dat)
with open('pyjutest.xml', 'w') as xml: