Skip to content

Commit f5a9a7b

Browse files
author
Oleh Prypin
authored
Add hooks to sys.modules because some Python features rely on this (#3193)
1 parent 324f486 commit f5a9a7b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

mkdocs/config/config_options.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,7 @@ def _load_hook(self, name, path):
10571057
if spec is None:
10581058
raise ValidationError(f"Cannot import path '{path}' as a Python module")
10591059
module = importlib.util.module_from_spec(spec)
1060+
sys.modules[name] = module
10601061
if spec.loader is None:
10611062
raise ValidationError(f"Cannot import path '{path}' as a Python module")
10621063
spec.loader.exec_module(module)

0 commit comments

Comments
 (0)