add context to signature mangling errors#95
Merged
pv merged 4 commits intonumpy:masterfrom Jun 18, 2017
Merged
Conversation
Contributor
Author
|
As an FYI: we accidentally had duplicate sections and they should have just been fixed, but without this patch it's hard to figure out where. |
pv
reviewed
Jun 18, 2017
numpydoc/numpydoc.py
Outdated
| try: | ||
| doc = SphinxDocString(pydoc.getdoc(obj)) | ||
| except ValueError as e: | ||
| filename = obj.__code__.co_filename |
Member
There was a problem hiding this comment.
That's Python 3 only, needs to be:
try:
filename = inspect.getsourcefile(obj)
except TypeError:
filename = None
Member
There was a problem hiding this comment.
Also, the full object name should in principle contained in name --- does it get shown by Sphinx?
d3f2c91 to
46036b0
Compare
Contributor
Author
|
@pv thanks, I now put the fix in the right place and made this much less hacky. That allowed me to add a test. |
Member
|
thanks lgtm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is slightly hacky (again) but hopefully also useful.
I ran into #67 in scikit-learn, but there was no info whatsoever where this came from. Now it gives the object name and file, so I could actually fix it. Even if #67 gets merged, there is still an error about the having yield and return which would have no context. If that is also removed then this code is not needed any more.