Fix asm_to_inline_asm.py for Python 3
This fixes the following error:
FAILED: gen/third_party/icu/icudtl_dat.cc
.../depot_tools/bootstrap-2@3_8_10_chromium_23_bin/python3/bin/python3.exe ../../../v8/third_party/icu/scripts/asm_to_inline_asm.py gen/third_party/icu/icudtl_dat.S gen/th
ird_party/icu/icudtl_dat.cc
Traceback (most recent call last):
File "../../../v8/third_party/icu/scripts/asm_to_inline_asm.py", line 31, in <module>
sys.exit(asm_to_inl_asm(args.input, args.output))
File "../../../v8/third_party/icu/scripts/asm_to_inline_asm.py", line 18, in asm_to_inl_asm
outfile.write('__asm__(\n')
TypeError: a bytes-like object is required, not 'str'
[208/1882] ACTION //:run_torque(//build/toolchain/win:x64)
ninja: build stopped: subcommand failed.
Change-Id: Ic2b3f737ff234a836bfdc2101f1f85fc6d57e7d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/deps/icu/+/3910618
Reviewed-by: Jungshik Shin <jshin@chromium.org>
Reviewed-by: Frank Tang <ftang@chromium.org>
diff --git a/scripts/asm_to_inline_asm.py b/scripts/asm_to_inline_asm.py
index 21d23e8..3392710 100644
--- a/scripts/asm_to_inline_asm.py
+++ b/scripts/asm_to_inline_asm.py
@@ -14,7 +14,7 @@
import sys
def asm_to_inl_asm(in_filename, out_filename):
- with open(in_filename, 'r') as infile, open(out_filename, 'wb') as outfile:
+ with open(in_filename, 'r') as infile, open(out_filename, 'w') as outfile:
outfile.write('__asm__(\n')
for line in infile:
# Escape " in .S file before outputing it to inline asm file.