From 07bc32118b37c7eb269752b8dde39c9058801fe5 Mon Sep 17 00:00:00 2001 From: "Marshall T. Vandegrift" Date: Mon, 6 Jul 2009 13:15:15 -0400 Subject: [PATCH] Fix nasty recursion bug. --- src/calibre/ebooks/mobi/writer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/writer.py b/src/calibre/ebooks/mobi/writer.py index 7e5bb77460..c2e5e2e72a 100644 --- a/src/calibre/ebooks/mobi/writer.py +++ b/src/calibre/ebooks/mobi/writer.py @@ -1954,7 +1954,7 @@ class MobiWriter(object): first = False else : self._oeb.logger.info('Generating flat CTOC ...') - for (i, child) in enumerate(toc.iter()): + for (i, child) in enumerate(toc.iterdescendants()): # Only add chapters or articles at depth==1 # no class defaults to 'chapter' if child.klass is None : child.klass = 'chapter'