[Lldb-commits] [lldb] r344386 - [lldbsuite] Fix the filecheck functionality to work with Python 3

Stella Stamenova via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 12 10:56:01 PDT 2018

Author: stella.stamenova
Date: Fri Oct 12 10:56:01 2018
New Revision: 344386

URL: http://llvm.org/viewvc/llvm-project?rev=344386&view=rev
[lldbsuite] Fix the filecheck functionality to work with Python 3

Summary: This is another string/byte conversion issue between Python 2 and 3. In Python 2, the subprocess communication expects a byte string, but in Python 3, it expects bytes. Since both versions are capable of using strings when universal_newlines is set to True AND filecheck operates on strings, force the use of strings.

Reviewers: zturner, asmith, vsk

Reviewed By: zturner

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D53166


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=344386&r1=344385&r2=344386&view=diff
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Fri Oct 12 10:56:01 2018
@@ -2240,7 +2240,7 @@ class TestBase(Base):
         filecheck_args = [filecheck_bin, check_file_abs]
         if filecheck_options:
-        subproc = Popen(filecheck_args, stdin=PIPE, stdout=PIPE, stderr=PIPE)
+        subproc = Popen(filecheck_args, stdin=PIPE, stdout=PIPE, stderr=PIPE, universal_newlines = True)
         cmd_stdout, cmd_stderr = subproc.communicate(input=output)
         cmd_status = subproc.returncode

More information about the lldb-commits mailing list