From 90917761ef7ea71ccda8147b3e1ebbc4675d9685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Fri, 9 Aug 2024 14:37:39 +0200 Subject: [PATCH] fix: Fix parsing Yields section (Google-style) when yielded values are tuples, and the description has more lines than tuple values --- src/_griffe/docstrings/google.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_griffe/docstrings/google.py b/src/_griffe/docstrings/google.py index 3b04fd4d..2b89823f 100644 --- a/src/_griffe/docstrings/google.py +++ b/src/_griffe/docstrings/google.py @@ -519,7 +519,7 @@ def _read_yields_section( annotation = parse_docstring_annotation(annotation, docstring) else: # try to retrieve the annotation from the docstring parent - with suppress(AttributeError, KeyError, ValueError): + with suppress(AttributeError, IndexError, KeyError, ValueError): annotation = docstring.parent.returns # type: ignore[union-attr] if annotation.is_iterator: yield_item = annotation.slice