[PATCH] doc: avoid using deprecated sphinx function

Caleb Connolly caleb.connolly at linaro.org
Tue Nov 14 16:18:02 CET 2023


The execfile_() function in sphinx has been removed after being
deprecated for some time. Follow what sphinx upstream does in [1] to
avoid using this function. This fixes "make htmldocs" on at least Arch
Linux but likely other distros too.

[1]: https://github.com/sphinx-doc/sphinx/commit/9ced1e355ad6baecd4e755a598a54877dc0aad44

Signed-off-by: Caleb Connolly <caleb.connolly at linaro.org>
---
base-commit: 92b27528d777ce85362af45e7d2974a6c856219b

// Caleb (they/them)
---
 doc/sphinx/load_config.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/doc/sphinx/load_config.py b/doc/sphinx/load_config.py
index eeb394b39e2c..977b27084780 100644
--- a/doc/sphinx/load_config.py
+++ b/doc/sphinx/load_config.py
@@ -3,7 +3,6 @@
 
 import os
 import sys
-from sphinx.util.pycompat import execfile_
 
 # ------------------------------------------------------------------------------
 def loadConfig(namespace):
@@ -48,7 +47,7 @@ def loadConfig(namespace):
             sys.stdout.write("load additional sphinx-config: %s\n" % config_file)
             config = namespace.copy()
             config['__file__'] = config_file
-            execfile_(config_file, config)
+            exec(config_file.read_text(), config)
             del config['__file__']
             namespace.update(config)
         else:



More information about the U-Boot mailing list