[Lldb-commits] [lldb] r354297 - [lldbtest] Fix some code to be compatible between py2 and py3.

Davide Italiano via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 18 15:18:14 PST 2019


Author: davide
Date: Mon Feb 18 15:18:14 2019
New Revision: 354297

URL: http://llvm.org/viewvc/llvm-project?rev=354297&view=rev
Log:
[lldbtest] Fix some code to be compatible between py2 and py3.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=354297&r1=354296&r2=354297&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Feb 18 15:18:14 2019
@@ -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)
 
 




More information about the lldb-commits mailing list