Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

da-woods
Copy link
Contributor

Fixes to:

  • some string methods
  • iter next (due to type slots)
  • module cleanup (temporary fix because access to module state is unreliable)

Fixes to:
* some string methods
* iter next (due to type slots)
* module cleanup (temporary fix because access to module state
  is unreliable)
@da-woods
Copy link
Contributor Author

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;")
Copy link
Contributor Author

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.

Copy link
Contributor Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant