Fix 'make gettext' fails when the '.. todolist::' directive is present. Closes #1364

Nodes that are replicated like todo don't have a uid, however i18n also unnecessary.
If extensions need to choose i18n for the extended nodes or not, we need another approach.
This commit is contained in:
Takayuki Shimizukawa
2014-03-02 14:40:29 +09:00
parent 1390388baa
commit 194e50fd2d
2 changed files with 4 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ Bugs fixed
* #1386: Fix bug preventing more than one theme being added by the entry point
mechanism.
* #1370: Ignore "toctree" nodes in text writer, instead of raising.
* #1364: Fix 'make gettext' fails when the '.. todolist::' directive is present.
Documentation
-------------

View File

@@ -55,6 +55,9 @@ class Catalog(object):
self.metadata = {} # msgid -> file, line, uid
def add(self, msg, origin):
if not hasattr(origin, 'uid'):
# Nodes that are replicated like todo don't have a uid, however i18n is also unnecessary.
return
if msg not in self.metadata: # faster lookup in hash
self.messages.append(msg)
self.metadata[msg] = []