diff options
author | Brad King <brad.king@kitware.com> | 2020-10-05 17:35:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-10-05 17:37:01 (GMT) |
commit | e0f643dddc4c66b6afd582b1bb659399d8c0b76a (patch) | |
tree | 54d473c51a8df534f0e99a08264790e2ae3fde4f /Utilities | |
parent | b1898bf97570b2887f7398105231ff72adb1564d (diff) | |
download | CMake-e0f643dddc4c66b6afd582b1bb659399d8c0b76a.zip CMake-e0f643dddc4c66b6afd582b1bb659399d8c0b76a.tar.gz CMake-e0f643dddc4c66b6afd582b1bb659399d8c0b76a.tar.bz2 |
Utilities/Sphinx: Clarify check for sphinx < 1.4
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/Sphinx/cmake.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py index f164fd0..d3aeb9d 100644 --- a/Utilities/Sphinx/cmake.py +++ b/Utilities/Sphinx/cmake.py @@ -92,18 +92,14 @@ from sphinx.roles import XRefRole from sphinx.util.nodes import make_refnode from sphinx import addnodes -# Needed for checking if Sphinx version is >= 1.4. -# See https://github.com/sphinx-doc/sphinx/issues/2673 -old_sphinx = False - +sphinx_before_1_4 = False try: from sphinx import version_info if version_info < (1, 4): - old_sphinx = True + sphinx_before_1_4 = True except ImportError: # The `sphinx.version_info` tuple was added in Sphinx v1.2: - old_sphinx = True - + sphinx_before_1_4 = True class CMakeModule(Directive): required_arguments = 1 @@ -181,7 +177,7 @@ class _cmake_index_entry: def __call__(self, title, targetid, main = 'main'): # See https://github.com/sphinx-doc/sphinx/issues/2673 - if old_sphinx: + if sphinx_before_1_4: return ('pair', u'%s ; %s' % (self.desc, title), targetid, main) else: return ('pair', u'%s ; %s' % (self.desc, title), targetid, main, None) |