diff --git a/gramps/plugins/importer/importxml.py b/gramps/plugins/importer/importxml.py index e0caa4ccf..04823d52f 100644 --- a/gramps/plugins/importer/importxml.py +++ b/gramps/plugins/importer/importxml.py @@ -2993,10 +2993,12 @@ class GrampsParser(UpdateCallback): obj.add_tag(tag_handle) def fix_not_instantiated(self): - uninstantiated = [(orig_handle, target) for orig_handle in - list(self.import_handles.keys()) if - [target for target in list(self.import_handles[orig_handle].keys()) if - not self.import_handles[orig_handle][target][INSTANTIATED]]] + uninstantiated = [] + for orig_handle in self.import_handles.keys(): + tglist = [target for target in self.import_handles[orig_handle].keys() if + not self.import_handles[orig_handle][target][INSTANTIATED]] + for target in tglist: + uninstantiated += [(orig_handle, target)] if uninstantiated: expl_note = create_explanation_note(self.db) self.db.commit_note(expl_note, self.trans, time.time())