hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/Documentation/sphinx/load_config.py
....@@ -3,7 +3,7 @@
33
44 import os
55 import sys
6
-from sphinx.util.pycompat import execfile_
6
+from sphinx.util.osutil import fs_encoding
77
88 # ------------------------------------------------------------------------------
99 def loadConfig(namespace):
....@@ -48,7 +48,9 @@
4848 sys.stdout.write("load additional sphinx-config: %s\n" % config_file)
4949 config = namespace.copy()
5050 config['__file__'] = config_file
51
- execfile_(config_file, config)
51
+ with open(config_file, 'rb') as f:
52
+ code = compile(f.read(), fs_encoding, 'exec')
53
+ exec(code, config)
5254 del config['__file__']
5355 namespace.update(config)
5456 else: