From 8222bd3645acf882fa49dc58974d0ca341b459d5 Mon Sep 17 00:00:00 2001 From: James Knight Date: Sat, 12 Oct 2024 16:47:10 -0400 Subject: [PATCH] Restore autodocs cut-lines with empty what-hints During typecheck improvements [1], the change accidentally removed the ability for autodoc's `cut_lines` call to run when no what-hints are provided. The `what` argument may be empty and an empty scenario should not stop the cut call from processing lines. [1]: https://github.com/sphinx-doc/sphinx/pull/12933 Signed-off-by: James Knight --- sphinx/ext/autodoc/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: