-
Notifications
You must be signed in to change notification settings - Fork 126
Fix VimPathFinder.find_spec (Python 3.4+) #297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
neovim/plugin/script_host.py
Outdated
# path appears to be the module then, and calling find_spec with it | ||
# fails. | ||
try: | ||
return sys.modules[fullname].__spec__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__spec__
might be None here.. seen when using jedi-vim, which apparently also comes here.
Need to investigate..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidhalter
Any idea maybe?
Maybe AttributeError could be handled like KeyError, but it would be good to know what is going on.
I do not have the details anymore, but am using this branch again now (to fix reload(jedi_vim)
in Neovim).
While #297 (comment) is not really clear, I think this PR is better than the current situation, where
|
This implements the correct interface for a path entry finder. Ref: https://docs.python.org/3.8/glossary.html#term-path-entry-finder
Found the issue: it was not using the correct interface ( |
LGTM. The flake8 failure happens on master, seems like a flake8 bug. flake8 version:
Did a web search but didn't find much. |
Could you reproduce it locally? |
@blueyed yes, in a virtualenv:
|
The fix is similar to what VimModuleLoader.find_module does already.