Skip to content
Snippets Groups Projects
Commit cec5ae48 authored by Federico Montesino Pouzols's avatar Federico Montesino Pouzols
Browse files

Merge pull request #14136 from mantidproject/doctest_runner_sphinx_versions

Update doctest runner for better compatability across sphinx versions
parents 3129476d 3950d075
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,7 @@ def main(sysarg):
output_dir = pathjoin(SPHINX_BUILD_DIR, BUILDER)
doctree_dir = pathjoin(SPHINX_BUILD_DIR, "doctrees")
argv = [sys.executable,
"-N",
"-b", BUILDER,
"-d", doctree_dir,
"-c", CONF_DIR,
......@@ -71,7 +72,7 @@ def main(sysarg):
% opts.testinclude)
# Run
import sphinx
import sphinx.cmdline
# IPython monkey patches the RegexLexer.get_tokens_unprocessed method and
# causes Sphinx to fall over. We need to put it back while processing
# the documentation
......@@ -83,7 +84,7 @@ def main(sysarg):
except AttributeError:
pass
try:
return_value = sphinx.main(argv)
return_value = sphinx.cmdline.main(argv)
finally:
from IPython.qt.console import pygments_highlighter
RegexLexer.get_tokens_unprocessed = pygments_highlighter.get_tokens_unprocessed
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment