Skip to content

Commit

Permalink
Merge pull request #8077 from tk0miya/8074_napoleon_crashes_by_cython
Browse files Browse the repository at this point in the history
Fix #8074: napoleon: Crashes during processing C-ext module
  • Loading branch information
tk0miya committed Aug 9, 2020
2 parents 40bdeb2 + 51332c7 commit a01acc4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES
Expand Up @@ -37,6 +37,8 @@ Features added
Bugs fixed
----------

* #8074: napoleon: Crashes during processing C-ext module

Testing
--------

Expand Down
5 changes: 4 additions & 1 deletion sphinx/ext/napoleon/docstring.py
Expand Up @@ -1074,7 +1074,10 @@ def __init__(self, docstring: Union[str, List[str]], config: SphinxConfig = None
super().__init__(docstring, config, app, what, name, obj, options)

def _get_location(self) -> str:
filepath = inspect.getfile(self._obj) if self._obj is not None else None
try:
filepath = inspect.getfile(self._obj) if self._obj is not None else None
except TypeError:
filepath = None
name = self._name

if filepath is None and name is None:
Expand Down

0 comments on commit a01acc4

Please sign in to comment.