From 1ea909270c6d9ad612a46c2a15c13acc4f6d623a Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 30 Aug 2019 23:54:13 +0000 Subject: [PATCH] [test] Make sys.stdout compatible with both Python 2 & 3 This time's the charm. llvm-svn: 370552 --- lldb/packages/Python/lldbsuite/test/lldbpexpect.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py index a72d36f82718..8f2d9e306385 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py +++ b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py @@ -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]