Skip to content

Commit 113afa0

Browse files
committed
fix: add error protection on linkcode module loading
1 parent 1f33a9f commit 113afa0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

docs/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ def linkcode_resolve(repo_link: str, domain: str, info: dict[str, str]) -> str |
6868
# in multiversion builds. We load the module from the file location instead
6969
spec = importlib.util.spec_from_file_location(info["module"], origin, submodule_search_locations=search_locations)
7070
module = importlib.util.module_from_spec(spec)
71-
spec.loader.exec_module(module)
71+
72+
try:
73+
spec.loader.exec_module(module)
74+
except Exception:
75+
return None
7276

7377
symbol = [module]
7478
for name in symbol_name.split("."):

0 commit comments

Comments
 (0)