gh-113993: For string interning, do not rely on (or assert) _Py_IsImmortal
Older stable ABI extensions are allowed to make immortal objects mortal.
Instead of _Py_IsImmortal, use _PyUnicode_STATE (interned and
statically_allocated), or skip asserts altogether.
- Issue: gh-113993
Thanks. I can confirm that it fixes the problem that I've hit with rustworkx and pyproject-fmt-rust.
:robot: New build scheduled with the buildbot fleet by @encukou for commit 4d92f62c7ddea826aa916081eded4d234621304a :robot:
If you want to schedule another build, you need to add the :hammer: test-with-buildbots label again.
Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. 🐍🍒⛏🤖
GH-121851 is a backport of this pull request to the 3.13 branch.