Commit 52ceac9f authored by Christian Biesinger's avatar Christian Biesinger Committed by Commit Bot

Use open() instead of the file constructor

This is required to make this script work with Python 3, but even
in Python 2 open is preferred over file():
https://docs.python.org/2/library/functions.html#file

Bug: 941669
Change-Id: I4738fc9bad81464c9ca5c9c15a3c51e9ee3f945d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1745488
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685372}
parent 57c1accd
...@@ -31,13 +31,13 @@ import detect_host_arch ...@@ -31,13 +31,13 @@ import detect_host_arch
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