[PATCH] D34793: [lit] Fix some convoluted logic around Unicode encoding, and de-duplicate across modules that used it.

David L. Jones via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 22:57:24 PDT 2017


dlj marked an inline comment as done.
dlj added inline comments.


================
Comment at: llvm/trunk/utils/lit/lit/util.py:70-71
         else: # OSX:
-            return int(capture(['sysctl', '-n', 'hw.ncpu']))
+            return int(subprocess.check_output(['sysctl', '-n', 'hw.ncpu'],
+                                               stderr=subprocess.STDOUT))
     # Windows:
----------------
MatzeB wrote:
> This isn't really related to str vs unicode is it? Can you please commit such changes separately and not "hide" them in a change such as this so we can revert and reason about them separately if necessary?
> (That said this particular change seems simple enough to me that post-commit review is enough without phab).
It's actually quite related... the capture() function basically did nothing but call subprocess.Popen, then pass the output through the strange encode/decode loop. So this was the only remaining (indirect) usage of convert_string.


Repository:
  rL LLVM

https://reviews.llvm.org/D34793





More information about the llvm-commits mailing list