Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BF(DOC): workaround for #10701 of sphinx in 5.1.0 #6883

Merged
merged 1 commit into from Jul 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/source/conf.py
Expand Up @@ -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