From 93dacedfed5f5a4d39b9e2a5a054e6aedddf88d8 Mon Sep 17 00:00:00 2001 From: shimizukawa Date: Sat, 17 Dec 2016 15:38:56 +0900 Subject: [PATCH] Fix #3253: In Py2 environment, building another locale with a non-captioned toctree produces `None` captions --- CHANGES | 2 ++ sphinx/addnodes.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index ad85d2ca0..07771f0ef 100644 --- a/CHANGES +++ b/CHANGES @@ -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) ===================================== diff --git a/sphinx/addnodes.py b/sphinx/addnodes.py index 95f58052d..b85637c87 100644 --- a/sphinx/addnodes.py +++ b/sphinx/addnodes.py @@ -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):