From 9b5547eae04b7be9798a6d1bf4d096da0a275bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 23 Dec 2016 11:46:16 +0100 Subject: [PATCH] Do not modify dictionary while iterating MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Needed for Python 3 compatibility Signed-off-by: Michal Čihař --- doc/_ext/configext.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/_ext/configext.py b/doc/_ext/configext.py index 7ed61fc0de..8e13f5159e 100644 --- a/doc/_ext/configext.py +++ b/doc/_ext/configext.py @@ -165,9 +165,12 @@ class ConfigFileDomain(Domain): } def clear_doc(self, docname): + toremove = [] for key, (fn, _) in self.data['objects'].items(): if fn == docname: - del self.data['objects'][key] + toremove.append(key) + for key in toremove: + del self.data['objects'][key] def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):