diff --git a/Misc/NEWS.d/next/Library/2026-06-25-11-52-00.gh-issue-151763.mW3xQp.rst b/Misc/NEWS.d/next/Library/2026-06-25-11-52-00.gh-issue-151763.mW3xQp.rst new file mode 100644 index 000000000000000..60f6b5b0a7552dc --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-06-25-11-52-00.gh-issue-151763.mW3xQp.rst @@ -0,0 +1,2 @@ +Fixed a possible crash during interpreter creation when memory allocation +fails in the free-threaded build. diff --git a/Python/pystate.c b/Python/pystate.c index fed1df0173bacf1..e0030bf136e05a9 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -1505,6 +1505,7 @@ alloc_threadstate(PyInterpreterState *interp) } reset_threadstate(tstate); } + tstate->base.interp = interp; return tstate; }