Print InspectError traceback in stubgen walk_packages when verbose is specified#18224
Conversation
This comment has been minimized.
This comment has been minimized.
hamdanal
left a comment
There was a problem hiding this comment.
Thanks. Could you print the traceback to stderr instead? You might also change find_module_paths_using_imports to print to stderr as well.
645f12f to
938757e
Compare
Done for both. |
|
(For future reference: try to avoid force pushing. It makes it hard to review changes. We squash merge anyway, so extra commits in the PR history doesn’t matter) |
Apologies - good call. |
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
This change modifies
walk_packagessuch that the fullImporErrortraceback is printed when a module cannot be imported. The goal is to provide the user with more context to debug the error.I implemented this change by mirroring existing behavior in
find_module_paths_using_imports:mypy/mypy/stubgen.py
Lines 1522 to 1529 in 9405bfd