[lit] Ensure test output is converted to strings where possible.

- This cleans up the text output of failing tests when run under PY3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188416 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar
2013-08-14 22:21:01 +00:00
parent 1b6e10f53b
commit 80a06baec2
7 changed files with 63 additions and 4 deletions

View File

@@ -156,4 +156,14 @@ def executeCommand(command, cwd=None, env=None):
if exitCode == -signal.SIGINT:
raise KeyboardInterrupt
# Ensure the resulting output is always of string type.
try:
out = str(out.decode('ascii'))
except:
out = str(out)
try:
err = str(err.decode('ascii'))
except:
err = str(err)
return out, err, exitCode