mirror of
https://github.com/Project-Babble/ProjectBabble.git
synced 2026-11-24 11:01:16 -08:00
Fix: shutil.SameFileError, removed "[INFO] Config Saved Successfully" print spam
This commit is contained in:
1 parent
e85073a51d
commit
16edfe4d8f
1 file changed
+3
-1
+3
-1
@@ -83,9 +83,11 @@ class BabbleConfig(BaseModel):
|
||||
BabbleConfig(**json.load(settings_file))
|
||||
shutil.copy(CONFIG_FILE_NAME, BACKUP_CONFIG_FILE_NAME)
|
||||
# print("Backed up settings files.") # Comment out because it's too loud.
|
||||
except shutil.SameFileError:
|
||||
pass
|
||||
except json.JSONDecodeError:
|
||||
# No backup because the saved settings file is broken.
|
||||
pass
|
||||
with open(CONFIG_FILE_NAME, "w") as settings_file:
|
||||
json.dump(obj=self.dict(), fp=settings_file, indent=2)
|
||||
print("[INFO] Config Saved Successfully")
|
||||
#print("[INFO] Config Saved Successfully")
|
||||
Reference in new issue
Block a user