mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 23:05:01 -06:00
Don't fail the samefile check if second file didn't exist
If the backup file didn't exist but the original did, then apparently they are not the same file so the copy should be allowed.
This commit is contained in:
parent
c9eb57cead
commit
5469613c17
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ class Backup:
|
|||
preferences_file_name = self._application.getApplicationName()
|
||||
preferences_file = Resources.getPath(Resources.Preferences, "{}.cfg".format(preferences_file_name))
|
||||
backup_preferences_file = os.path.join(version_data_dir, "{}.cfg".format(preferences_file_name))
|
||||
if not os.path.samefile(preferences_file, backup_preferences_file):
|
||||
if os.path.exists(preferences_file) and (not os.path.exists(backup_preferences_file) or not os.path.samefile(preferences_file, backup_preferences_file)):
|
||||
Logger.log("d", "Copying preferences file from %s to %s", preferences_file, backup_preferences_file)
|
||||
shutil.copyfile(preferences_file, backup_preferences_file)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue