[Lldb-commits] [lldb] r370552 - [test] Make sys.stdout compatible with both Python 2 & 3

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 30 16:54:14 PDT 2019


Author: jdevlieghere
Date: Fri Aug 30 16:54:13 2019
New Revision: 370552

URL: http://llvm.org/viewvc/llvm-project?rev=370552&view=rev
Log:
[test] Make sys.stdout compatible with both Python 2 & 3

This time's the charm.

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbpexpect.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbpexpect.py?rev=370552&r1=370551&r2=370552&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lldbpexpect.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbpexpect.py Fri Aug 30 16:54:13 2019
@@ -28,7 +28,8 @@ else:
             self.child.expect_exact(self.PROMPT)
 
         def launch(self, executable=None, timeout=30, dimensions=None):
-            logfile = sys.stdout.buffer if self.TraceOn() else None
+            logfile = getattr(sys.stdout, 'buffer',
+                              sys.stdout) if self.TraceOn() else None
             args = ['--no-lldbinit', '--no-use-colors']
             for cmd in self.setUpCommands():
                 args += ['-O', cmd]




More information about the lldb-commits mailing list