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

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 10:23:09 PDT 2017


MatzeB 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:
----------------
dlj wrote:
> 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.
ok, makes sense.


Repository:
  rL LLVM

https://reviews.llvm.org/D34793





More information about the llvm-commits mailing list