diff --git a/docs/source/conf.py b/docs/source/conf.py index 41014f4c83..08f2dc06f3 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -351,3 +351,24 @@ def setup(sphinx): ), None), } + + +import sphinx +if sphinx.__version__ == '5.1.0': + # see https://github.com/sphinx-doc/sphinx/issues/10701 + # hope is it would get fixed for the next release + + # Although crash happens within NumpyDocstring, it is subclass of GoogleDocstring + # so we need to overload method there + from sphinx.ext.napoleon.docstring import GoogleDocstring + from functools import wraps + + + @wraps(GoogleDocstring._consume_inline_attribute) + def _consume_inline_attribute_safe(self): + try: + return self._consume_inline_attribute_safe() + except: + return "", [] + + GoogleDocstring._consume_inline_attribute = _consume_inline_attribute_safe \ No newline at end of file