Can't pop dictionary keys while looping

This commit is contained in:
Veronica K. B. Olsen
2019-05-30 20:18:40 +02:00
parent a2d0f937ae
commit fa33d42fe2
+4 -1
View File
@@ -152,9 +152,12 @@ class NWIndex():
isNovel = False
# Also clear references to file in tag index
clearTags = []
for aTag in self.tagIndex:
if self.tagIndex[aTag][1] == tHandle:
self.tagIndex.pop(aTag)
clearTags.append(aTag)
for aTag in clearTags:
self.tagIndex.pop(aTag)
nLine = 0
for aLine in theText.splitlines():