From 17d1f06065fe9f878f997b71a9ca35c0d68f6442 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Thu, 19 Oct 2017 17:14:21 -0700 Subject: [PATCH] Whoops, previous commit only worked on Sphinx 1.5+ --- releases/util.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/releases/util.py b/releases/util.py index 6bfaaa2..e792e97 100644 --- a/releases/util.py +++ b/releases/util.py @@ -13,8 +13,18 @@ from docutils.nodes import bullet_list from sphinx.application import Sphinx # not exposed at top level # NOTE: importing these from environment for backwards compat with Sphinx 1.3 from sphinx.environment import ( - SphinxStandaloneReader, SphinxFileInput, SphinxDummyWriter, sphinx_domains, + SphinxStandaloneReader, SphinxFileInput, SphinxDummyWriter, ) +# sphinx_domains is only in Sphinx 1.5+, but is presumably necessary from then +# onwards. +try: + from sphinx.util.docutils import sphinx_domains +except ImportError: + # Just dummy it up. + from contextlib import contextmanager + @contextmanager + def sphinx_domains(env): + yield from . import construct_releases, setup