From 6b282e98f29147e16330241a993fdaeaf01063b9 Mon Sep 17 00:00:00 2001 From: Quentin Soubeyran <45202794+QuentinSoubeyran@users.noreply.github.com> Date: Wed, 7 Oct 2020 09:51:16 +0200 Subject: [PATCH] added behavior for exceptions --- sphinx/ext/napoleon/docstring.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/ext/napoleon/docstring.py b/sphinx/ext/napoleon/docstring.py index 03f16a25d7..ec99211ccf 100644 --- a/sphinx/ext/napoleon/docstring.py +++ b/sphinx/ext/napoleon/docstring.py @@ -602,7 +602,7 @@ class GoogleDocstring: lines = [] for _name, _type, _desc in self._consume_fields(): # code adapted from autodoc.AttributeDocumenter:add_directive_header - if not _type and self._what == 'class' and self._obj: + if not _type and self._what in ('class', 'exception') and self._obj: if self._config.napoleon_google_attr_annotations: # cache the class annotations if not hasattr(self, "_annotations"):