-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fix --incremental crash on Type[...] #4038
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
Is this something urgent (fixing a regression in a recent change) that should be cherry-picked into the release branch? Or is this something that has been around for a long time? It seems the second crash in #3852 is related to pointing mypypath to site-packages, which is not recommended. |
The bug is quite old (around a year), it started to be a crash in 0.510. So I don't think it is something urgent.
The crash doesn't depend on |
self.item = item.fallback | ||
else: | ||
self.item = item | ||
self.item = item |
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.
Why does this change help? Is it because the type
attribute of an Instance
might refer to FakeInfo
during deserialization?
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.
Yes.
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.
(Or previously to None
)
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.
LGTM. Thanks for the fix!
This fixes the second traceback reported in #3852. This also improves member lookup on
Type[...]
by moving it to a later stage (checkmember.py
instead of some manipulations inTypeType
constructor that are dangerous during de-serialization).By the way it looks like the first traceback reported in #3852 is just another manifestation of #3052, but instead of just deleting a class it is replaced by a
Var
or by aFunctionDef
.Also fixes #4058.