mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-04 15:34:55 -05:00
prevent crash that occurs when changing models.yaml on windows systems
Windows does not support an atomic `os.rename()` operation. This PR changes it to `os.replace()`, which does the same thing.
This commit is contained in:
@@ -298,7 +298,7 @@ class ModelCache(object):
|
||||
with open(tmpfile, 'w') as outfile:
|
||||
outfile.write(self.preamble())
|
||||
outfile.write(yaml_str)
|
||||
os.rename(tmpfile,config_file_path)
|
||||
os.replace(tmpfile,config_file_path)
|
||||
|
||||
def preamble(self):
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user