Skip to content

Commit 270bf6c

Browse files
authored
MAINT: Work around Sphinx deprecation (#301)
1 parent 8a203b7 commit 270bf6c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pydata_sphinx_theme/bootstrap_html_translator.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
"""A custom Sphinx HTML Translator for Bootstrap layout
22
"""
3+
from distutils.version import LooseVersion
34
from docutils import nodes
45

6+
import sphinx
57
from sphinx.writers.html5 import HTML5Translator
68
from sphinx.util import logging
79
from sphinx.ext.autosummary import autosummary_table
@@ -24,7 +26,10 @@ def visit_table(self, node):
2426
# type: (nodes.Element) -> None
2527
# copy of sphinx source to *not* add 'docutils' and 'align-default' classes
2628
# but add 'table' class
27-
self.generate_targets_for_table(node)
29+
30+
# generate_targets_for_table is deprecated in 4.0
31+
if LooseVersion(sphinx.__version__) < LooseVersion("4.0"):
32+
self.generate_targets_for_table(node)
2833

2934
self._table_row_index = 0
3035

0 commit comments

Comments
 (0)