Limit theme registration to 1.6+

This call was added in 1.6
This commit is contained in:
Anthony Johnson 2020-05-02 14:43:22 -06:00
parent 69e594d6a1
commit 8534484967
No known key found for this signature in database
GPG Key ID: 709FE91423F05AA0

View File

@ -21,7 +21,9 @@ def get_html_theme_path():
# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
def setup(app):
app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__)))
if sphinx.version_info >= (1, 6, 0):
# Register the theme that can be referenced without adding a theme path
app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__)))
if sphinx.version_info >= (1, 8, 0):
# Add Sphinx message catalog for newer versions of Sphinx