deal with non-directories in diffusers/

This commit is contained in:
Lincoln Stein 2023-03-05 12:29:52 -05:00
parent 4e9e1b660d
commit fc187f263e

View File

@ -966,7 +966,10 @@ class ModelManager(object):
if dest.is_symlink():
print(f"** Found symlink at {dest.name}. Not migrating.")
elif dest.exists():
rmtree(source)
if source.is_dir():
rmtree(source)
else:
source.unlink()
else:
move(source, dest)