From 5167115cf63b88e2139ebf1499d9185cdbeae4ac Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Thu, 5 Nov 2015 01:33:44 +0000 Subject: Python 3 - Use universal_newlines=True in subprocess.Popen. This follows the spirit of a previous patch which did essentially the same thing. In Python 3, when you use Popen.communicate(), you get back a bytes object which cannot normally be treated as a string. We could decode this manually, but universal_newlines=True does this automatically, and there's no disadvantage to doing so even on Python 2. So just enable it always. llvm-svn: 252126 --- lldb/packages/Python/lldbsuite/test/test_runner/lib/process_control.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lldb/packages/Python/lldbsuite/test/test_runner') diff --git a/lldb/packages/Python/lldbsuite/test/test_runner/lib/process_control.py b/lldb/packages/Python/lldbsuite/test/test_runner/lib/process_control.py index 50bcdab33c5..4e8f554e37f 100644 --- a/lldb/packages/Python/lldbsuite/test/test_runner/lib/process_control.py +++ b/lldb/packages/Python/lldbsuite/test/test_runner/lib/process_control.py @@ -271,6 +271,7 @@ class UnixProcessHelper(ProcessHelper): stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + universal_newlines=True, # Elicits automatic byte -> string decoding in Py3 close_fds=True, preexec_fn=preexec_func) @@ -383,6 +384,7 @@ class WindowsProcessHelper(ProcessHelper): stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + universal_newlines=True, # Elicits automatic byte -> string decoding in Py3 creationflags=creation_flags) def was_hard_terminate(self, returncode): -- cgit v1.2.3