Fix #3253: In Py2 environment, building another locale with a non-captioned toctree produces None captions

This commit is contained in:
shimizukawa 2016-12-17 15:38:56 +09:00
parent 1ccfb9736b
commit 93dacedfed
2 changed files with 3 additions and 1 deletions

View File

@ -11,6 +11,8 @@ Bugs fixed
----------
* #3246: xapian search adapter crashes
* #3253: In Py2 environment, building another locale with a non-captioned
toctree produces `None` captions
Release 1.5.1 (released Dec 13, 2016)
=====================================

View File

@ -49,7 +49,7 @@ class toctree(nodes.General, nodes.Element, translatable):
"""Node for inserting a "TOC tree"."""
def preserve_original_messages(self):
if 'caption' in self:
if self.get('caption'):
self['rawcaption'] = self['caption']
def apply_translated_message(self, original_message, translated_message):