-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 caching of PEP 561 namespace packages with missing submodules #12250
Conversation
This comment has been minimized.
This comment has been minimized.
Fixes python#12232 Another "fail every 2nd run" bug
bfeae2c
to
d682434
Compare
This comment has been minimized.
This comment has been minimized.
Diff from mypy_primer, showing the effect of this PR on open source code: pyinstrument (https://github.com/joerick/pyinstrument)
- pyinstrument/vendor/appdirs.py:533: error: Cannot find implementation or library stub for module named "com.sun"
+ pyinstrument/vendor/appdirs.py:562: error: Cannot find implementation or library stub for module named "com.sun"
|
@@ -415,9 +415,9 @@ follow_imports = error | |||
[file a.py] | |||
/ # No error reported | |||
[out] | |||
main.py:1: error: Import of "a" ignored | |||
main.py:1: note: (Using --follow-imports=error, module not passed on command line) | |||
main.py:2: note: Revealed type is "Any" |
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.
This actually makes it match the comments in the test case
Seems like no takers on reviews, so I'm going to go ahead and merge. Any fixes for namespace packages are probably really good to get in ahead of #9636 |
Fixes #12232
Another "fail every 2nd run" bug
if not self.is_module(sub_id):
, the parent can come before another child, and we fail to resolve the parent.