From 4fc43c2b324c960abff641e15f9e7afabc0280ef Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 3 Jun 2021 09:25:59 +0200 Subject: [PATCH] Compare version-objects, not strings. This would've gone so wrong if we actually released 4.10 without this, since, as a string, 4.10 is 'smaller than' 4.6 (for example), because alphanumerical-order. done as part of CURA-8269 --- cura/Backups/Backup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cura/Backups/Backup.py b/cura/Backups/Backup.py index 6f4a44d37e..d9f1788744 100644 --- a/cura/Backups/Backup.py +++ b/cura/Backups/Backup.py @@ -14,6 +14,7 @@ from UM.Logger import Logger from UM.Message import Message from UM.Platform import Platform from UM.Resources import Resources +from UM.Version import Version if TYPE_CHECKING: from cura.CuraApplication import CuraApplication @@ -134,8 +135,8 @@ class Backup: "Tried to restore a Cura backup without having proper data or meta data.")) return False - current_version = self._application.getVersion() - version_to_restore = self.meta_data.get("cura_release", "master") + current_version = Version(self._application.getVersion()) + version_to_restore = Version(self.meta_data.get("cura_release", "master")) if current_version < version_to_restore: # Cannot restore version newer than current because settings might have changed.