diff --git a/src/griffe/agents/visitor.py b/src/griffe/agents/visitor.py index c5ddc1be..c97eabee 100644 --- a/src/griffe/agents/visitor.py +++ b/src/griffe/agents/visitor.py @@ -503,7 +503,7 @@ def visit_import(self, node: ast.Import) -> None: node: The node to visit. """ for name in node.names: - alias_path = name.name + alias_path = name.name.split(".", 1)[0] alias_name = name.asname or alias_path.split(".", 1)[0] self.current.imports[alias_name] = alias_path self.current.set_member(