-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
string/iter/shutdown limited API fixes #6169
base: master
Are you sure you want to change the base?
Conversation
Fixes to: * some string methods * iter next (due to type slots) * module cleanup (temporary fix because access to module state is unreliable)
This is basically just linked by fixing some tests in "tests/run" which begin with "b". |
# (e.g. during interpreter shutdown). | ||
# In that case the safest thing is to give up. | ||
code.putln(f"if (!PyState_FindModule(&{Naming.pymoduledef_cname}))") | ||
code.putln("return;") |
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.
I think this change won't be needed after #5323. That's the "right" fix, and this is just a fairly quick temporary measure.
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.
I'm less convinced it'll be completely unneeded after a bit more thought (since destructors can call into arbitrary code outside the module's cleanup function). Further refactors to reduce the dependence of PyState_FindModule
will help though. And we might be able to split it into cached constants (safe) and everything else (unsafe).
Fixes to: