This is an archive of the discontinued LLVM Phabricator instance.

[LIT] Make util.executeCommand python3 friendly
ClosedPublic

Authored by EricWF on Jan 14 2017, 4:34 PM.

Details

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').

Diff Detail

Event Timeline

EricWF updated this revision to Diff 84466.Jan 14 2017, 4:34 PM
EricWF retitled this revision from to [LIT] Make util.executeCommand python3 friendly.
EricWF updated this object.
EricWF added reviewers: ddunbar, dim, BinaryKhaos.
EricWF added a subscriber: llvm-commits.
dim edited edge metadata.Jan 16 2017, 11:56 AM

LGTM, though I am not a python 3 expert, by any means. :)

EricWF accepted this revision.Jan 17 2017, 4:22 PM

Accepting. There hasn't been a lot of interest and this seems fine for post-commit review.

This revision is now accepted and ready to land.Jan 17 2017, 4:22 PM
EricWF closed this revision.Jan 17 2017, 4:23 PM