From b2c89259ef63bc1e404c4c16fabe9d4fd51b1975 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 12 Feb 2009 12:09:00 +0100 Subject: [PATCH] Fix todolist crash when no todo entry is there. --- sphinx/ext/todo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sphinx/ext/todo.py b/sphinx/ext/todo.py index dac906604c..c8c6412ced 100644 --- a/sphinx/ext/todo.py +++ b/sphinx/ext/todo.py @@ -61,6 +61,9 @@ def process_todo_nodes(app, doctree, fromdocname): # Augment each todo with a backlink to the original location. env = app.builder.env + if not hasattr(env, 'todo_all_todos'): + env.todo_all_todos = [] + for node in doctree.traverse(todolist): if not app.config['todo_include_todos']: node.replace_self([])