llvm.org GIT mirror llvm / 610d2e4
Fix update_mir_test_checks.py to run on python3 Split off from D58817 Differential Revision: https://reviews.llvm.org/D58820 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355268 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 8 months ago
1 changed file(s) with 3 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
6161 with open(ir) as ir_file:
6262 stdout = subprocess.check_output('{} {}'.format(self.bin, args),
6363 shell=True, stdin=ir_file)
64 if sys.version_info[0] > 2:
65 stdout = stdout.decode()
6466 # Fix line endings to unix CR style.
6567 stdout = stdout.replace('\r\n', '\n')
6668 return stdout
407409 log('Writing {} lines to {}...'.format(len(output_lines), test), verbose)
408410
409411 with open(test, 'wb') as fd:
410 fd.writelines([l + '\n' for l in output_lines])
412 fd.writelines(['{}\n'.format(l).encode('utf-8') for l in output_lines])
411413
412414
413415 def main():