mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
fix atomic file replace on windows
This commit is contained in:
parent
2e0ee5f5b2
commit
79b098c409
3 changed files with 3 additions and 3 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue