[Lldb-commits] [PATCH] D53166: [lldbsuite] Fix the filecheck functionality to work with Python 3

Stella Stamenova via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 12 10:45:54 PDT 2018


stella.stamenova added inline comments.


================
Comment at: packages/Python/lldbsuite/test/lldbtest.py:2247-2249
         subproc = Popen(filecheck_args, stdin=PIPE, stdout=PIPE, stderr=PIPE)
         cmd_stdout, cmd_stderr = subproc.communicate(input=output)
         cmd_status = subproc.returncode
----------------
zturner wrote:
> If I'm not mistaken, Python 3 can accept `stdin` as `bytes` or `string`, and either will work, it depends on the value of `universal_newlines`, and `stdout` will be in whatever format `stdin` was in.  If we pass `universal_newlines=True`, then it will expect a `string` and output a `string`, otherwise it expects a `bytes` and output a `bytes`.  Given that `FileCheck` is supposed to operate on textual data and not binary data, perhaps we should be doing that here?
Brilliant! :)


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D53166





More information about the lldb-commits mailing list