From: Reid Priedhorsky <reidpr@lanl.gov>
Date: Sun, 17 Nov 2024 16:50:32 +0100
Subject: Do not use deprecated get_html_theme_path for newer Sphinx versions

Origin: backport, https://gitlab.com/charliecloud/main/-/commit/4016adc74cad3a927b959940cb3c7142cdbb0238
Bug: https://gitlab.com/charliecloud/main/-/issues/1929
Bug-Debian: https://bugs.debian.org/1086621
---
 doc/conf.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/doc/conf.py b/doc/conf.py
index 5958857..1937f09 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -130,8 +130,10 @@ html_theme = 'sphinx_rtd_theme'
 # but it is needed in 1.2.3. I don't know where the boundary is. We embed it
 # in try/except so that "docs-sane" can import the file too.
 try:
-   import sphinx_rtd_theme
-   html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+   import sphinx
+   if (sphinx.version_info < (1, 8, 5)):
+      import sphinx_rtd_theme
+      html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
 except ImportError:
    pass  # error caught elsewhere
 
