Utilities/Sphinx: Fix cmake domain document removal with python3
In the domain clear_doc method, avoid removing entries from a dictionary while iterating over it. Instead accumulate a set of entries to remove at the end.
This commit is contained in:
parent
69069cfb1a
commit
d55671ad9d
|
@ -290,9 +290,12 @@ class CMakeDomain(Domain):
|
||||||
}
|
}
|
||||||
|
|
||||||
def clear_doc(self, docname):
|
def clear_doc(self, docname):
|
||||||
|
to_clear = set()
|
||||||
for fullname, (fn, _) in self.data['objects'].items():
|
for fullname, (fn, _) in self.data['objects'].items():
|
||||||
if fn == docname:
|
if fn == docname:
|
||||||
del self.data['objects'][fullname]
|
to_clear.add(fullname)
|
||||||
|
for fullname in to_clear:
|
||||||
|
del self.data['objects'][fullname]
|
||||||
|
|
||||||
def resolve_xref(self, env, fromdocname, builder,
|
def resolve_xref(self, env, fromdocname, builder,
|
||||||
typ, target, node, contnode):
|
typ, target, node, contnode):
|
||||||
|
|
Loading…
Reference in New Issue