Skip to content

Commit

Permalink
BF(DOC): workaround for #10701 of sphinx in 5.1.0
Browse files Browse the repository at this point in the history
See sphinx-doc/sphinx#10701 for more information.
I have not checked if rendered docs are anyhow affected etc. I hope the issue
would get fixed asap since should affect lots of sphinx users
  • Loading branch information
yarikoptic committed Jul 24, 2022
1 parent cefecae commit c7ba04e
Showing 1 changed file with 21 additions and 0 deletions.
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

0 comments on commit c7ba04e

Please sign in to comment.