summaryrefslogtreecommitdiff
path: root/sphinx/addnodes.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/addnodes.py')
-rw-r--r--sphinx/addnodes.py2
1 files changed, 1 insertions, 1 deletions
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):