diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py index f2c1ed93782..41051205a33 100644 --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -209,7 +209,7 @@ def process( options: dict[str, bool], lines: list[str], ) -> None: - if what_ not in what_unique: + if what_unique and what_ not in what_unique: return del lines[:pre] if post: