Index: infra/bots/win_toolchain_utils.py |
diff --git a/infra/bots/win_toolchain_utils.py b/infra/bots/win_toolchain_utils.py |
index 43f62863cde3de8a457830d6339c50bc8bc47e4e..f8033e925bbdbd729199772d3adff95b38b35e05 100644 |
--- a/infra/bots/win_toolchain_utils.py |
+++ b/infra/bots/win_toolchain_utils.py |
@@ -10,6 +10,8 @@ |
import json |
+import os |
+import stat |
PLACEHOLDER = '<(TOOLCHAIN_BASE_DIR)' |
@@ -36,6 +38,9 @@ def _replace(val, before, after): |
def _replace_in_file(filename, before, after): |
"""Replace occurrences of one string with another within the file.""" |
+ # Make the file writeable, or the below won't work. |
+ os.chmod(filename, stat.S_IWRITE) |
+ |
with open(filename) as f: |
contents = json.load(f) |
new_contents = _replace(contents, before, after) |