Replace with sed when regex is required.
(search, replace, filename)
| 57 | |
| 58 | |
| 59 | def replace_string_in_line(search, replace, filename): |
| 60 | """Replace with sed when regex is required.""" |
| 61 | with open(filename, "r") as source: |
| 62 | content = source.read() |
| 63 | with open(filename, "w") as source: |
| 64 | source.write(re.sub(search, replace, content)) |
| 65 | |
| 66 | |
| 67 | class Version(object): |
no test coverage detected