From 8a2ad56f619cbc61fa9e7003d96f88a5e2e374b3 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Tue, 30 Apr 2013 13:21:11 +0000 Subject: [PATCH] 6624: import an exported XML crashes gramps 4.0 - Actually a logic bug python 2 does not crash on. svn: r22122 --- src/plugins/import/ImportXml.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/plugins/import/ImportXml.py b/src/plugins/import/ImportXml.py index ecac5a6a6..2bffcf784 100644 --- a/src/plugins/import/ImportXml.py +++ b/src/plugins/import/ImportXml.py @@ -2939,10 +2939,13 @@ class GrampsParser(UpdateCallback): obj.add_tag(tag_handle) def fix_not_instantiated(self): - uninstantiated = [(orig_handle, target) for orig_handle in - self.import_handles.keys() if - [target for target in 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 = Utils.create_explanation_note(self.db) self.db.commit_note(expl_note, self.trans, time.time())