From: Georg Brandl Date: Tue, 27 Oct 2009 20:13:06 +0000 (+0000) Subject: Create the function before using it. X-Git-Tag: v2.6.5rc1~427 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f23fcf519443e7bcf27a30c6d91b9526aa7c580;p=python Create the function before using it. --- diff --git a/Doc/tools/sphinxext/pyspecific.py b/Doc/tools/sphinxext/pyspecific.py index 8607531b24..ff07adb7a6 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('%s' % 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