diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-09-12 11:31:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-12 11:31:17 (GMT) |
commit | 94a684734f669eab02b5c915394b749ccf936449 (patch) | |
tree | cf1a3969d60d9f81b4d7a66edcf3a01d5658b9c1 /Doc/tools/extensions | |
parent | 1fc84b64f9f740f2dc089da1d061dfdd5b438d3c (diff) | |
download | cpython-94a684734f669eab02b5c915394b749ccf936449.zip cpython-94a684734f669eab02b5c915394b749ccf936449.tar.gz cpython-94a684734f669eab02b5c915394b749ccf936449.tar.bz2 |
bpo-36675: Remove obsolete code. (GH-16024)
Does no longer work since Sphinx moved the trim_doctest_flag option in
the configuration.
(cherry picked from commit 2c910c1e732c9a3ec4c67a7c43d789d6c729304a)
Co-authored-by: Julien Palard <julien@palard.fr>
Diffstat (limited to 'Doc/tools/extensions')
-rw-r--r-- | Doc/tools/extensions/pyspecific.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 82dfc6b..2d95612 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -29,7 +29,6 @@ except ImportError: from sphinx.locale import translators from sphinx.util import status_iterator, logging from sphinx.util.nodes import split_explicit_title -from sphinx.writers.html import HTMLTranslator from sphinx.writers.text import TextWriter, TextTranslator from sphinx.writers.latex import LaTeXTranslator from sphinx.domains.python import PyModulelevel, PyClassmember @@ -49,37 +48,6 @@ Body.enum.converters['loweralpha'] = \ Body.enum.converters['lowerroman'] = \ Body.enum.converters['upperroman'] = lambda x: None -# monkey-patch HTML and LaTeX translators to keep doctest blocks in the -# doctest docs themselves -orig_visit_literal_block = HTMLTranslator.visit_literal_block -orig_depart_literal_block = LaTeXTranslator.depart_literal_block - - -def new_visit_literal_block(self, node): - meta = self.builder.env.metadata[self.builder.current_docname] - old_trim_doctest_flags = self.highlighter.trim_doctest_flags - if 'keepdoctest' in meta: - self.highlighter.trim_doctest_flags = False - try: - orig_visit_literal_block(self, node) - finally: - self.highlighter.trim_doctest_flags = old_trim_doctest_flags - - -def new_depart_literal_block(self, node): - meta = self.builder.env.metadata[self.curfilestack[-1]] - old_trim_doctest_flags = self.highlighter.trim_doctest_flags - if 'keepdoctest' in meta: - self.highlighter.trim_doctest_flags = False - try: - orig_depart_literal_block(self, node) - finally: - self.highlighter.trim_doctest_flags = old_trim_doctest_flags - - -HTMLTranslator.visit_literal_block = new_visit_literal_block -LaTeXTranslator.depart_literal_block = new_depart_literal_block - # Support for marking up and linking to bugs.python.org issues |