To put it another way:
(from issue33608#msg358748)
> The docs [1] aren't super clear about it, but there are some fundamental
> assumptions we make about runtime finalization:
>
> * no use of the C-API while Py_FinalizeEx() is executing (except for a
> few helpers like Py_Initialized)
> * only a small portion of the C-API is available afterward (at least
> until Py_Initialize() is run)
>
> I guess the real question is what to do about this?
>
>[1] https://docs.python.org/3/c-api/init.html#c.Py_FinalizeEx
Adding to that list:
* no other Python threads are running once we start finalizing the runtime (not far into Py_FinalizeEx()) |