summaryrefslogtreecommitdiffstats
path: root/Doc/tools
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-10-27 20:13:06 (GMT)
committerGeorg Brandl <georg@python.org>2009-10-27 20:13:06 (GMT)
commit0f23fcf519443e7bcf27a30c6d91b9526aa7c580 (patch)
treeefdf5fb791fd7749f8df2501e1b01a75df0a0f9c /Doc/tools
parent9c76a98ed1ecfdb613c3a0140eba0df0efe17c03 (diff)
downloadcpython-0f23fcf519443e7bcf27a30c6d91b9526aa7c580.zip
cpython-0f23fcf519443e7bcf27a30c6d91b9526aa7c580.tar.gz
cpython-0f23fcf519443e7bcf27a30c6d91b9526aa7c580.tar.bz2
Create the function before using it.
Diffstat (limited to 'Doc/tools')
-rw-r--r--Doc/tools/sphinxext/pyspecific.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Doc/tools/sphinxext/pyspecific.py b/Doc/tools/sphinxext/pyspecific.py
index 8607531..ff07adb 100644
--- a/Doc/tools/sphinxext/pyspecific.py
+++ b/Doc/tools/sphinxext/pyspecific.py
@@ -21,10 +21,6 @@ Body.enum.converters['loweralpha'] = \
Body.enum.converters['upperroman'] = lambda x: None
# monkey-patch HTML translator to give versionmodified paragraphs a class
-from sphinx.writers.html import HTMLTranslator
-from sphinx.locale import versionlabels
-HTMLTranslator.visit_versionmodified = new_visit_versionmodified
-
def new_visit_versionmodified(self, node):
self.body.append(self.starttag(node, 'p', CLASS=node['type']))
text = versionlabels[node['type']] % node['version']
@@ -34,6 +30,9 @@ def new_visit_versionmodified(self, node):
text += '.'
self.body.append('<span class="versionmodified">%s</span>' % text)
+from sphinx.writers.html import HTMLTranslator
+from sphinx.locale import versionlabels
+HTMLTranslator.visit_versionmodified = new_visit_versionmodified
# Support for marking up and linking to bugs.python.org issues