-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-92031: Improve test for unquickening static code #92440
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
_handle_fromlist(dis, [name], lambda *args: None) | ||
from dis import _all_opmap | ||
resume = _all_opmap["RESUME"] | ||
resume_quick = _all_opmap["RESUME_QUICK"] |
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 not putting this code inside the code string?
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.
Since this is testing parts of importlib
, I'd like to use as little import machinery as possible, so there's no chance that imports prematurely specialize the _handle_fromlist
.
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.
Maybe add a comment to explain it, since it's not obvious the first time that I read the code: the code starts with "Assert initially unquickened".
Thanks @sweeneyde for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
…pythonGH-92440) (cherry picked from commit 27185f9) Co-authored-by: Dennis Sweeney <[email protected]>
Merged, thanks! |
GH-92699 is a backport of this pull request to the 3.11 branch. |
…2440) (cherry picked from commit 27185f9) Co-authored-by: Dennis Sweeney <[email protected]>
This test is deterministic, faster, and directly tests the behavior it's supposed to be testing, rather than relying on some C-level assertion to fail.
I checked that commenting out
deopt_code(...)
in_PyStaticCode_Dealloc
causes the test to fail reliably.cc @vstinner @markshannon