Fix TopicTreeTraverser when doing breadth traversal on Python 3

Python 3 orders maps differently from Python 2, so sort the subtopics before
traversing them like is done with depth traversal.
This commit is contained in:
Scott Talbert
2016-08-16 00:15:36 -04:00
parent 0a80536c8b
commit cf59ae09fb

View File

@@ -55,6 +55,8 @@ class TopicTreeTraverser:
def extendQueue(subtopics):
topics.append(visitor._startChildren)
# put subtopics in list in alphabetical order
subtopics.sort(key=topicObj.__class__.getName)
topics.extend(subtopics)
topics.append(visitor._endChildren)