Skip to content

Commit 2e76685

Browse files
authored
Merge pull request #308 from rgommers/fix-missing-obj
BUG: fix an incomplete check in `Reader._error_location`
2 parents 8275f4e + 24ab40c commit 2e76685

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)