Skip to content

Commit 440cc45

Browse files
committed
refactor: Don't expect a config_file_path attribute on passed tool config
This makes us compatible with Zensical when running as a Markdown extension directly.
1 parent e07c882 commit 440cc45

File tree

1 file changed

+1
-1
lines changed
  • src/mkdocstrings_handlers/python/_internal

1 file changed

+1
-1
lines changed

src/mkdocstrings_handlers/python/_internal/handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def get_handler(
434434
# We therefore increase the limit here, once, before Griffe is used to collect or render stuff.
435435
sys.setrecursionlimit(max(sys.getrecursionlimit(), 2000))
436436

437-
base_dir = Path(tool_config.config_file_path or "./mkdocs.yml").parent
437+
base_dir = Path(getattr(tool_config, "config_file_path", None) or "./mkdocs.yml").parent
438438
if "inventories" not in handler_config and "import" in handler_config:
439439
warn("The 'import' key is renamed 'inventories' for the Python handler", FutureWarning, stacklevel=1)
440440
handler_config["inventories"] = handler_config.pop("import", [])

0 commit comments

Comments
 (0)