]> granicus.if.org Git - llvm/commit
[LIT] Make util.executeCommand python3 friendly
authorEric Fiselier <eric@efcs.ca>
Wed, 18 Jan 2017 00:12:41 +0000 (00:12 +0000)
committerEric Fiselier <eric@efcs.ca>
Wed, 18 Jan 2017 00:12:41 +0000 (00:12 +0000)
commit38777f9b2662fb2b24c58345c440d80ae4e5f810
tree235c029226003e4c35fa512ab5726a87efa1f9b5
parentfb0c1c57019a559db247e956a8377850cce984cd
[LIT] Make util.executeCommand python3 friendly

Summary: The parameter `input` to `subprocess.Popen.communicate(...)` must be an object of type `bytes` . This is strictly enforced in python3. This patch (1) allows `to_bytes` to be safely called redundantly. (2) Explicitly convert `input` within `executeCommand`. This allows for usages like `executeCommand(['clang++', '-'], input='int main() {}\n')`.

Reviewers: ddunbar, BinaryKhaos, modocache, dim, EricWF

Reviewed By: EricWF

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292308 91177308-0d34-0410-b5e6-96231b3b80d8
utils/lit/lit/util.py