From 011ebcfa851aaab04399eced76cbdfac1b7bdf9b Mon Sep 17 00:00:00 2001 From: tristanlatr Date: Tue, 2 Apr 2024 21:36:52 -0400 Subject: [PATCH] Fix mypy --- pydoctor/astbuilder.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pydoctor/astbuilder.py b/pydoctor/astbuilder.py index 7c99d9be6..124f7f065 100644 --- a/pydoctor/astbuilder.py +++ b/pydoctor/astbuilder.py @@ -186,6 +186,10 @@ def _handleReExport(info:'ReExport', elsewhere:Collection['ReExport']) -> None: as_name = info.as_name target_parent = target.parent + if target_parent is None: + # TODO: warn because we can't reparent a root module + return None + # Remember that this name is re-exported target_parent.exported[target.name] = target