diff --git a/src/scanpydoc/elegant_typehints/_autodoc_patch.py b/src/scanpydoc/elegant_typehints/_autodoc_patch.py index 3e1c898..10a7db4 100644 --- a/src/scanpydoc/elegant_typehints/_autodoc_patch.py +++ b/src/scanpydoc/elegant_typehints/_autodoc_patch.py @@ -32,6 +32,8 @@ def add_directive_header(self: ClassDocumenter, sig: str) -> None: ) # But maybe in the future it will lines.replace(f":{role}:`{old_name}`", f":{role}:`{new_name}`") + if any("." not in name for name in (old_name, new_name)): + continue # pragma: no cover old_mod, old_cls = old_name.rsplit(".", 1) new_mod, new_cls = new_name.rsplit(".", 1) replace_multi_suffix(