Browse Source

Simplify _is_any_version_compatible

It now literally says: for any version, is it compatible?

Contributes to issue CURA-7207.
Ghostkeeper 5 years ago
parent
commit
bcf4bc8138
1 changed files with 6 additions and 5 deletions
  1. 6 5
      plugins/Toolbox/src/CloudSync/SubscribedPackagesModel.py

+ 6 - 5
plugins/Toolbox/src/CloudSync/SubscribedPackagesModel.py

@@ -74,8 +74,9 @@ class SubscribedPackagesModel(ListModel):
 
     @staticmethod
     def _is_any_version_compatible(package_manager: PackageManager, api_versions: [str]) -> bool:
-        """:return: True when any of the provided api versions is compatible"""
-        for version in api_versions:
-            if package_manager.isPackageCompatible(Version(version)):
-                return True
-        return False
+        """
+        Check a list of version numbers if any of them applies to our
+        application.
+        :return: ``True`` when any of the provided API versions is compatible.
+        """
+        return any(package_manager.isPackageCompatible(Version(version)) for version in api_versions)