Skip to content

Commit 16edfe4

Browse files
committed
Fix: shutil.SameFileError, removed "[INFO] Config Saved Successfully" print spam
1 parent e85073a commit 16edfe4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

BabbleApp/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@ def save(self):
8383
BabbleConfig(**json.load(settings_file))
8484
shutil.copy(CONFIG_FILE_NAME, BACKUP_CONFIG_FILE_NAME)
8585
# print("Backed up settings files.") # Comment out because it's too loud.
86+
except shutil.SameFileError:
87+
pass
8688
except json.JSONDecodeError:
8789
# No backup because the saved settings file is broken.
8890
pass
8991
with open(CONFIG_FILE_NAME, "w") as settings_file:
9092
json.dump(obj=self.dict(), fp=settings_file, indent=2)
91-
print("[INFO] Config Saved Successfully")
93+
#print("[INFO] Config Saved Successfully")

0 commit comments

Comments
 (0)