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
Fix python importing-error handling #3162
Conversation
Sorry, I made a mistake in repro steps:
correct: |
Codecov Report
@@ Coverage Diff @@
## master #3162 +/- ##
==========================================
+ Coverage 76.55% 76.55% +<.01%
==========================================
Files 93 93
Lines 136839 136857 +18
==========================================
+ Hits 104752 104769 +17
- Misses 32087 32088 +1
Continue to review full report at Codecov.
|
Can you update this pull request for the latest changes? |
Thank you, I updated this. |
The coverage dropped probably because of whitespace changes. |
The coverage dropped probably because of whitespace changes.
So is this ready to be included now?
…--
Seen on the back of a biker's vest: If you can read this, my wife fell off.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
do 'load_module' in 'LoaderLoadModule'
LGTM |
@brammool This patch is ready to be merged. |
Problem
When importing python module, there is the case that the error occurred from module is incorrect.
(both
+python
and+python3
)Repro steps
/path/to/vim is Vim git repository.
The following step uses failing_import.py module in vim/src/testdir/pythonx.
start Vim:
vim --clean
then get
ImportError
:Expected:
ImportError()
(empty message)Actual:
ImportError('No module named failing_import)
(below)ImportError
reports "No module named" thoughfailing_import
module exists.That is,
ImportError
emitted from module inside is not propagated correctly.Also python3.
Cause
vim.find_module
does both finding and loading all intermediate packages and module, soImportError
in loading is treated as the error in finding module.Solution
.
in its name) invim.load_module