Commit 7cf4add6 authored by Vadim Gorbachev's avatar Vadim Gorbachev Committed by Commit Bot

Python3 compatibility: use open() instead of file()


For details see: https://python-future.org/compatible_idioms.html#file


Bug: chromium:948824
Change-Id: Ib06568963073621bd8edf2c8edb89bf8253d3bcb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1549169Reviewed-by: 's avatarSergiy Belozorov <sergiyb@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60660}
parent d88f4d33
...@@ -27,13 +27,13 @@ BINUTILS_OUT = 'Release' ...@@ -27,13 +27,13 @@ BINUTILS_OUT = 'Release'
def ReadFile(filename): def ReadFile(filename):
with file(filename, 'r') as f: with open(filename, 'r') as f:
return f.read().strip() return f.read().strip()
def WriteFile(filename, content): def WriteFile(filename, content):
assert not os.path.exists(filename) assert not os.path.exists(filename)
with file(filename, 'w') as f: with open(filename, 'w') as f:
f.write(content) f.write(content)
f.write('\n') f.write('\n')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment