Merge pull request #3520 from chiizujin/sort_exits

Fix exit order sorting sometimes being incorrect for exits not in the sort order
This commit is contained in:
Griatch 2024-04-27 20:49:05 +02:00 committed by GitHub
commit f456dc9fca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1595,7 +1595,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
return names
sort_index = {name: key for key, name in enumerate(exit_order)}
names = sorted(names)
end_pos = len(names) + 1
end_pos = len(sort_index)
names.sort(key=lambda name: sort_index.get(name, end_pos))
return names