summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2019-02-18 23:18:14 +0000
committerDavide Italiano <davide@freebsd.org>2019-02-18 23:18:14 +0000
commit05709acba49a0ead78f33487ef377ff2ef376496 (patch)
treeda3e6789249ea25c6d32c2d43b6bcd37e0380024 /lldb/packages/Python/lldbsuite/test
parent1dbc72185a0d86d0c7f6f95a40aefba560d3196e (diff)
downloadbcm5719-llvm-05709acba49a0ead78f33487ef377ff2ef376496.tar.gz
bcm5719-llvm-05709acba49a0ead78f33487ef377ff2ef376496.zip
[lldbtest] Fix some code to be compatible between py2 and py3.
llvm-svn: 354297
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py22
1 files changed, 4 insertions, 18 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index f1b0d9a1d57..4a492b078af 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -438,27 +438,13 @@ def system(commands, **kwargs):
stdout=PIPE,
stderr=PIPE,
shell=True,
- universal_newlines=True,
+ #encoding="utf-8",
+ #universal_newlines=True,
**kwargs)
pid = process.pid
this_output, this_error = process.communicate()
retcode = process.poll()
- # Enable trace on failure return while tracking down FreeBSD buildbot
- # issues
- trace = traceAlways
- if not trace and retcode and sys.platform.startswith("freebsd"):
- trace = True
-
- with recording(test, trace) as sbuf:
- print(file=sbuf)
- print("os command:", shellCommand, file=sbuf)
- print("with pid:", pid, file=sbuf)
- print("stdout:", this_output, file=sbuf)
- print("stderr:", this_error, file=sbuf)
- print("retcode:", retcode, file=sbuf)
- print(file=sbuf)
-
if retcode:
cmd = kwargs.get("args")
if cmd is None:
@@ -471,8 +457,8 @@ def system(commands, **kwargs):
"command": shellCommand
}
raise cpe
- output = output + this_output
- error = error + this_error
+ output = output + this_output.decode("utf-8")
+ error = error + this_error.decode("utf-8")
return (output, error)
OpenPOWER on IntegriCloud