(pattern: str, repl: str, filename: str | Path)
| 17 | |
| 18 | |
| 19 | def sed_i(pattern: str, repl: str, filename: str | Path) -> None: |
| 20 | with open(filename, "rb") as f: |
| 21 | data = f.read() |
| 22 | |
| 23 | if (newdata := re.sub(pattern.encode("utf8"), repl.encode("utf8"), data)) != data: |
| 24 | with open(filename, "wb") as f: |
| 25 | f.write(newdata) |
| 26 | |
| 27 | |
| 28 | shutil.copytree(pdir / "psycopg_c", target) |
no test coverage detected