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

@ -48,7 +48,7 @@ def _write_state(prefix: Prefix, venv: str, state: object) -> None:
with open(staging, 'w') as state_file:
state_file.write(json.dumps(state))
# Move the file into place atomically to indicate we've installed
os.rename(staging, state_filename)
os.replace(staging, state_filename)
def _hook_installed(hook: Hook) -> bool: