diff options
| author | Manuel Traut <manut@linutronix.de> | 2017-09-20 08:26:35 +0200 |
|---|---|---|
| committer | Manuel Traut <manut@linutronix.de> | 2017-09-20 08:26:35 +0200 |
| commit | 1ffe2b3096b6f3d2d03f4eb8320a5727e49838f8 (patch) | |
| tree | 93541a5af40e66fe8b01e336b9d25c979e8916ac | |
| parent | 3b36049c75a0c67be830a6683cf57f17d0e348c2 (diff) | |
be more specific about bytes and strings
needed to run with python3
Signed-off-by: Manuel Traut <manut@linutronix.de>
| -rwxr-xr-x | pyjutest | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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: |
