Browse Source

Fixed mypy typing failure

@ghostkeeper being nerd snipped
It's giving that typing failure because the section variable is re-used.
First as elements from self._getSections (strs) and then as elements
from sorted_sections.values() (List[PackageModel]s). Python has no
variable scopes within functions so the variable still exists after the
first for loop.

Contributes to CURA-8558
Jelle Spijker 3 years ago
parent
commit
e7aecb6c06
1 changed files with 2 additions and 2 deletions
  1. 2 2
      plugins/Marketplace/LocalPackageList.py

+ 2 - 2
plugins/Marketplace/LocalPackageList.py

@@ -62,8 +62,8 @@ class LocalPackageList(PackageList):
             sorted_sections[section] = sorted(packages, key = lambda p: p.displayName)
 
         # Append the order PackageModels to the list
-        for section in sorted_sections.values():
-            for package_data in section:
+        for sorted_section in sorted_sections.values():
+            for package_data in sorted_section:
                 self.appendItem({"package": package_data})
 
         self.setIsLoading(False)