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

@ -79,7 +79,7 @@ class Store:
self._create_config_table(db)
# Atomic file move
os.rename(tmpfile, self.db_path)
os.replace(tmpfile, self.db_path)
@contextlib.contextmanager
def exclusive_lock(self) -> Generator[None, None, None]: