Skip to content

Commit 24ab40c

Browse files
committed
BUG: fix an incomplete check in Reader._error_location
It's unclear why `self._obj` can be None, but that's what I'm seeing when trying numpydoc master to build SciPy master. This fix gives the right traceback.
1 parent 8275f4e commit 24ab40c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

numpydoc/docscrape.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def _parse(self):
412412
self[section] = content
413413

414414
def _error_location(self, msg, error=True):
415-
if hasattr(self, '_obj'):
415+
if hasattr(self, '_obj') and self._obj is not None:
416416
# we know where the docs came from:
417417
try:
418418
filename = inspect.getsourcefile(self._obj)

0 commit comments

Comments
 (0)