diff options
author | Ralf Gommers <ralf.gommers@gmail.com> | 2021-01-02 15:20:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-02 15:20:23 +0000 |
commit | 2e766859a5542e3ed0e7f189ffa8871efbd20495 (patch) | |
tree | 96d7a21a195ba90812e3dec5da5fe4ad9413538b | |
parent | 8275f4e9d32c232f66516351e69c6a09eb7f16d6 (diff) | |
parent | 24ab40cca60c1b2ad6af96a0dd175ee4c82f9731 (diff) | |
download | numpydoc-2e766859a5542e3ed0e7f189ffa8871efbd20495.tar.gz |
Merge pull request #308 from rgommers/fix-missing-obj
BUG: fix an incomplete check in `Reader._error_location`
-rw-r--r-- | numpydoc/docscrape.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py index c669ffc..15b4e10 100644 --- a/numpydoc/docscrape.py +++ b/numpydoc/docscrape.py @@ -412,7 +412,7 @@ class NumpyDocString(Mapping): self[section] = content def _error_location(self, msg, error=True): - if hasattr(self, '_obj'): + if hasattr(self, '_obj') and self._obj is not None: # we know where the docs came from: try: filename = inspect.getsourcefile(self._obj) |