Skip to content

Commit bd73497

Browse files
committed
fix: Don't try loading packages from relative paths
Issue-145: #145
1 parent 3cf7055 commit bd73497

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/mkdocstrings_handlers/python/handler.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,16 @@ def collect(self, identifier: str, config: Mapping[str, Any]) -> CollectorItem:
283283
try:
284284
for pre_loaded_module in final_config.get("preload_modules") or []:
285285
if pre_loaded_module not in self._modules_collection:
286-
loader.load(pre_loaded_module, find_stubs_package=final_config["find_stubs_package"])
287-
loader.load(module_name, find_stubs_package=final_config["find_stubs_package"])
286+
loader.load(
287+
pre_loaded_module,
288+
try_relative_path=False,
289+
find_stubs_package=final_config["find_stubs_package"],
290+
)
291+
loader.load(
292+
module_name,
293+
try_relative_path=False,
294+
find_stubs_package=final_config["find_stubs_package"],
295+
)
288296
except ImportError as error:
289297
raise CollectionError(str(error)) from error
290298
unresolved, iterations = loader.resolve_aliases(

0 commit comments

Comments
 (0)