From 23fcb91c2f651d5f248bcc0b3ecfd5f29f25dd8d Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 9 May 2021 21:32:56 +0900 Subject: [PATCH] Fix #9189: autodoc: crashed by ValueError on generating signature of property Autodoc is crashed if `inspect.signature` raises ValueError on generating signature from a property of the class. It seems the original code re-raise the exception meaningless. So this ignores it even if raised. --- CHANGES | 3 +++ sphinx/ext/autodoc/__init__.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index e710d1da2..4c98ee569 100644 --- a/CHANGES +++ b/CHANGES @@ -16,6 +16,9 @@ Features added Bugs fixed ---------- +* #9189: autodoc: crashed when ValueError is raised on generating signature + from a property of the class + Testing -------- diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py index c92709deb..de94ff1c5 100644 --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -2570,7 +2570,7 @@ class PropertyDocumenter(DocstringStripSignatureMixin, ClassLevelDocumenter): # self.fullname, exc) return None except ValueError: - raise + return None class NewTypeAttributeDocumenter(AttributeDocumenter):