diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-01-30 16:15:59 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-01-30 16:15:59 +0000 |
| commit | d82bd4d9119c4b0850f8e18360d0f70ab5eb08aa (patch) | |
| tree | a6a76e0be4ead304e10299d701763edffd4d557f /llvm/utils | |
| parent | 362653f7afec25c71604f18856011bd02071a555 (diff) | |
| download | bcm5719-llvm-d82bd4d9119c4b0850f8e18360d0f70ab5eb08aa.tar.gz bcm5719-llvm-d82bd4d9119c4b0850f8e18360d0f70ab5eb08aa.zip | |
[utils] Fix update scripts output when run on python3.
This fixes a "bytes-like object is required, not 'str'" python3 error I hit on update_llc_test_checks.py (but present on the other scripts as well) by matching what update_mca_test_checks.py already does, plus I've added an explicit 'utf-8' encoding.
llvm-svn: 352633
Diffstat (limited to 'llvm/utils')
| -rwxr-xr-x | llvm/utils/update_analyze_test_checks.py | 2 | ||||
| -rwxr-xr-x | llvm/utils/update_llc_test_checks.py | 2 | ||||
| -rwxr-xr-x | llvm/utils/update_mca_test_checks.py | 2 | ||||
| -rwxr-xr-x | llvm/utils/update_test_checks.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/llvm/utils/update_analyze_test_checks.py b/llvm/utils/update_analyze_test_checks.py index 64e64e090af..4d1d912aba8 100755 --- a/llvm/utils/update_analyze_test_checks.py +++ b/llvm/utils/update_analyze_test_checks.py @@ -186,7 +186,7 @@ def main(): print('Writing %d lines to %s...' % (len(output_lines), test), file=sys.stderr) with open(test, 'wb') as f: - f.writelines([l + '\n' for l in output_lines]) + f.writelines(['{}\n'.format(l).encode('utf-8') for l in output_lines]) if __name__ == '__main__': diff --git a/llvm/utils/update_llc_test_checks.py b/llvm/utils/update_llc_test_checks.py index 960fee232dc..5d2aac2509e 100755 --- a/llvm/utils/update_llc_test_checks.py +++ b/llvm/utils/update_llc_test_checks.py @@ -172,7 +172,7 @@ def main(): print('Writing %d lines to %s...' % (len(output_lines), test), file=sys.stderr) with open(test, 'wb') as f: - f.writelines([l + '\n' for l in output_lines]) + f.writelines(['{}\n'.format(l).encode('utf-8') for l in output_lines]) if __name__ == '__main__': diff --git a/llvm/utils/update_mca_test_checks.py b/llvm/utils/update_mca_test_checks.py index 06fd655ab79..87ac19b39ae 100755 --- a/llvm/utils/update_mca_test_checks.py +++ b/llvm/utils/update_mca_test_checks.py @@ -551,7 +551,7 @@ def _write_output(test_path, input_lines, prefix_list, block_infos, # noqa 'Writing {} lines to {}...\n\n'.format(len(output_lines), test_path)) with open(test_path, 'wb') as f: - f.writelines(['{}\n'.format(l).encode() for l in output_lines]) + f.writelines(['{}\n'.format(l).encode('utf-8') for l in output_lines]) def main(): args = _parse_args() diff --git a/llvm/utils/update_test_checks.py b/llvm/utils/update_test_checks.py index 6d0bf0479c0..b63a9174208 100755 --- a/llvm/utils/update_test_checks.py +++ b/llvm/utils/update_test_checks.py @@ -183,7 +183,7 @@ def main(): print('Writing %d lines to %s...' % (len(output_lines), test), file=sys.stderr) with open(test, 'wb') as f: - f.writelines([l + '\n' for l in output_lines]) + f.writelines(['{}\n'.format(l).encode('utf-8') for l in output_lines]) if __name__ == '__main__': |

