fix atomic file replace on windows

This commit is contained in:
Anthony Sottile 2020-08-23 10:18:59 -07:00
parent 2e0ee5f5b2
commit 79b098c409
3 changed files with 3 additions and 3 deletions

View file

@ -165,7 +165,7 @@ def _uninstall_hook_script(hook_type: str) -> None:
output.write_line(f'{hook_type} uninstalled')
if os.path.exists(legacy_path):
os.rename(legacy_path, hook_path)
os.replace(legacy_path, hook_path)
output.write_line(f'Restored previous hooks to {hook_path}')