diff options
author | Louis Dionne <ldionne@apple.com> | 2019-08-23 15:05:54 +0000 |
---|---|---|
committer | Louis Dionne <ldionne@apple.com> | 2019-08-23 15:05:54 +0000 |
commit | 344eee9227daa69b3ad919790da5a0edcf02c9cb (patch) | |
tree | 44952e3d155825d10a52b121d892282e0b353af7 | |
parent | dabfea85fcca49e8bb4a2690621c1fcea30bd4f3 (diff) | |
download | bcm5719-llvm-344eee9227daa69b3ad919790da5a0edcf02c9cb.tar.gz bcm5719-llvm-344eee9227daa69b3ad919790da5a0edcf02c9cb.zip |
[libc++] Improve Python 3 compatibility for merge_archives.py
Popen.communicate() method in Python 2 returns a pair of strings, and in
Python 3 it returns a pair of byte-like objects unless universal_newlines
is set to True. This led to an error when using Python 3. With this patch,
merge_archives.py works fine with Python 3.
Thanks to Sergej Jaskiewicz for the patch.
Differential Revision: https://reviews.llvm.org/D66649
llvm-svn: 369764
-rwxr-xr-x | libcxx/utils/merge_archives.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libcxx/utils/merge_archives.py b/libcxx/utils/merge_archives.py index 5c04bc915a4..4c31854d2b7 100755 --- a/libcxx/utils/merge_archives.py +++ b/libcxx/utils/merge_archives.py @@ -50,7 +50,8 @@ def execute_command(cmd, cwd=None): 'stdin': subprocess.PIPE, 'stdout': subprocess.PIPE, 'stderr': subprocess.PIPE, - 'cwd': cwd + 'cwd': cwd, + 'universal_newlines': True } p = subprocess.Popen(cmd, **kwargs) out, err = p.communicate() |