mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-23 22:29:41 +08:00
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:
parent
07fcf8b533
commit
e7aecb6c06
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user