From 18b34eea90fd71eba4a0539df4739c9577664397 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Tue, 30 Apr 2013 13:22:07 +0000 Subject: [PATCH] 6624: import an exported XML crashes gramps 4.0 - Actually a logic bug python 2 does not crash on. svn: r22124 --- gramps/plugins/importer/importxml.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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())