diff options
author | Ghostkeeper <rubend@tutanota.com> | 2020-02-04 16:20:08 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2020-02-04 16:20:08 +0300 |
commit | ccc295e2bccaddab56890c095f60edb295bcf56f (patch) | |
tree | d349eed5b5ea443a965e631cd6f081a820c880ec /plugins/VersionUpgrade/VersionUpgrade44to45 | |
parent | f38dc82ac8f3986707d83129d6f3656d8d033054 (diff) |
Use sets for folder names from the start
We use a set here because we want to remove the current version from it later on. However if we change the variable to contain a set instead of a list, MyPy will start complaining that we change the type.
Contributes to issue CURA-7024.
Diffstat (limited to 'plugins/VersionUpgrade/VersionUpgrade44to45')
-rw-r--r-- | plugins/VersionUpgrade/VersionUpgrade44to45/VersionUpgrade44to45.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/VersionUpgrade/VersionUpgrade44to45/VersionUpgrade44to45.py b/plugins/VersionUpgrade/VersionUpgrade44to45/VersionUpgrade44to45.py index 4daf8cef83..09aab9b123 100644 --- a/plugins/VersionUpgrade/VersionUpgrade44to45/VersionUpgrade44to45.py +++ b/plugins/VersionUpgrade/VersionUpgrade44to45/VersionUpgrade44to45.py @@ -38,7 +38,7 @@ class VersionUpgrade44to45(VersionUpgrade): # If you're starting from an earlier version, you can't have had the bug that produces too many hidden stacks (https://github.com/Ultimaker/Cura/issues/6731). # If you're starting from a later version, the bug was already fixed. data_storage_root = os.path.dirname(Resources.getDataStoragePath()) - folders = os.listdir(data_storage_root) # All version folders. + folders = set(os.listdir(data_storage_root)) # All version folders. folders = set(filter(lambda p: re.fullmatch(r"\d+\.\d+", p), folders)) # Only folders with a correct version number as name. folders.difference_update({os.path.basename(Resources.getDataStoragePath())}) # Remove current version from candidates (since the folder was just copied). if folders: |