[Python-checkins] cpython (3.4): Issue #22695: Fix rendering of the deprecated-removed role in HTML.

berker.peksag python-checkins at python.org
Sat Nov 8 21:40:49 CET 2014


https://hg.python.org/cpython/rev/9001298e3094
changeset:   93440:9001298e3094
branch:      3.4
parent:      93437:246c9570a757
user:        Berker Peksag <berker.peksag at gmail.com>
date:        Sat Nov 08 22:40:22 2014 +0200
summary:
  Issue #22695: Fix rendering of the deprecated-removed role in HTML.

files:
  Doc/tools/extensions/pyspecific.py |  10 ++++------
  1 files changed, 4 insertions(+), 6 deletions(-)


diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py
--- a/Doc/tools/extensions/pyspecific.py
+++ b/Doc/tools/extensions/pyspecific.py
@@ -172,22 +172,20 @@
             messages = []
         if self.content:
             self.state.nested_parse(self.content, self.content_offset, node)
+        if len(node):
             if isinstance(node[0], nodes.paragraph) and node[0].rawsource:
                 content = nodes.inline(node[0].rawsource, translatable=True)
                 content.source = node[0].source
                 content.line = node[0].line
                 content += node[0].children
                 node[0].replace_self(nodes.paragraph('', '', content))
-                node[0].insert(0, nodes.inline('', '%s: ' % text,
-                                               classes=['versionmodified']))
+            node[0].insert(0, nodes.inline('', '%s: ' % text,
+                                           classes=['versionmodified']))
         else:
             para = nodes.paragraph('', '',
                                    nodes.inline('', '%s.' % text,
                                                 classes=['versionmodified']))
-            if len(node):
-                node.insert(0, para)
-            else:
-                node.append(para)
+            node.append(para)
         env = self.state.document.settings.env
         env.note_versionchange('deprecated', version[0], node, self.lineno)
         return [node] + messages

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list