diff options
author | Ghostkeeper <rubend@tutanota.com> | 2018-11-26 11:40:14 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2018-11-26 11:40:14 +0300 |
commit | 5469613c17c0caa34b58750a1aeeb664333886ca (patch) | |
tree | aa6bb1e5b3fd884c796cf04eaa72b367d00310dc /cura/Backups | |
parent | c9eb57ceade38f567fc49f5e5ad0f6f1c8913d79 (diff) |
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.
Diffstat (limited to 'cura/Backups')
-rw-r--r-- | cura/Backups/Backup.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cura/Backups/Backup.py b/cura/Backups/Backup.py index 80681acb4f..714d6527fe 100644 --- a/cura/Backups/Backup.py +++ b/cura/Backups/Backup.py @@ -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) |