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
This commit is contained in:
Jelle Spijker 2021-11-03 16:29:35 +01:00 committed by Jelle Spijker
parent 07fcf8b533
commit e7aecb6c06
No known key found for this signature in database
GPG Key ID: 6662DC033BE6B99A

View File

@ -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)