Merge pull request #8077 from tk0miya/8074_napoleon_crashes_by_cython

Fix #8074: napoleon: Crashes during processing C-ext module
This commit is contained in:
Takeshi KOMIYA 2020-08-09 14:31:16 +09:00 committed by GitHub
commit a01acc4e1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -37,6 +37,8 @@ Features added
Bugs fixed
----------
* #8074: napoleon: Crashes during processing C-ext module
Testing
--------

View File

@ -1074,7 +1074,10 @@ class NumpyDocstring(GoogleDocstring):
super().__init__(docstring, config, app, what, name, obj, options)
def _get_location(self) -> str:
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: