From b4ef4da181c629ccc596e55ee1c2ef310c086c35 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 29 Dec 2009 17:06:35 +0100 Subject: [PATCH] Another try to fix docutils version differences. --- sphinx/builders/epub.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py index 46cf7641e..7a11b291d 100644 --- a/sphinx/builders/epub.py +++ b/sphinx/builders/epub.py @@ -160,7 +160,12 @@ class EpubBuilder(StandaloneHTMLBuilder): """Remove all HTML markup and return only the text nodes.""" for c in doctree.children: if isinstance(c, nodes.Text): - result.append(c) + try: + # docutils 0.4 and 0.5: Text is a UserString subclass + result.append(c.data) + except AttributeError: + # docutils 0.6: Text is a unicode subclass + result.append(c) else: result = self.collapse_text(c, result) return result