From c4e7179bfa35f38bd0034c0ed34cb6c827524128 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Tue, 30 Apr 2013 13:21:27 +0000 Subject: [PATCH] 6624: import an exported XML crashes gramps 4.0 - Actually a logic bug python 2 does not crash on. svn: r22123 --- 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 2c997cdae..cc8acde93 100644 --- a/gramps/plugins/importer/importxml.py +++ b/gramps/plugins/importer/importxml.py @@ -3011,10 +3011,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())