From e3f64c0f07ca71d7139d97c05a7e90ce191da7f3 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 6 Apr 2012 19:38:32 +0900 Subject: [PATCH] if there's no LastRepetition element, don't try import learning data --- anki/importing/supermemo_xml.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/anki/importing/supermemo_xml.py b/anki/importing/supermemo_xml.py index bed819333..bdacc4080 100644 --- a/anki/importing/supermemo_xml.py +++ b/anki/importing/supermemo_xml.py @@ -235,7 +235,9 @@ class SupermemoXmlImporter(NoteImporter): # pre-process scheduling data # convert learning data - if not self.META.resetLearningData and item.Interval >= 1: + if (not self.META.resetLearningData + and item.Interval >= 1 + and getattr(item, "LastRepetition", None)): # migration of LearningData algorithm tLastrep = time.mktime(time.strptime(item.LastRepetition, '%d.%m.%Y')) tToday = time.time()