(file_path, old_string, new_string, is_regex=False)
| 160 | |
| 161 | |
| 162 | def replace_in_file(file_path, old_string, new_string, is_regex=False): |
| 163 | with open(file_path, "r+") as file: |
| 164 | if not is_regex: |
| 165 | old_string = re.escape(old_string) |
| 166 | data = re.sub(old_string, new_string, file.read()) |
| 167 | file.seek(0) |
| 168 | file.write(data) |
| 169 | file.truncate() |
| 170 | |
| 171 | |
| 172 | def update_java(chrome_milestone): |
no test coverage detected