bpo-39947: Add PyThreadState_GetInterpreter() by vstinner · Pull Request #18981 · python/cpython
Expand Up
@@ -540,7 +540,7 @@ faulthandler_py_enable(PyObject *self, PyObject *args, PyObject *kwargs)
Py_XSETREF(fatal_error.file, file);
fatal_error.fd = fd;
fatal_error.all_threads = all_threads;
fatal_error.interp = tstate->interp;
fatal_error.interp = PyThreadState_GetInterpreter(tstate);
if (faulthandler_enable() < 0) { return NULL; Expand Down Expand Up @@ -756,7 +756,7 @@ faulthandler_dump_traceback_later(PyObject *self, /* the downcast is safe: we check that 0 < timeout_us < PY_TIMEOUT_MAX */ thread.timeout_us = (PY_TIMEOUT_T)timeout_us; thread.repeat = repeat; thread.interp = tstate->interp; thread.interp = PyThreadState_GetInterpreter(tstate); thread.exit = exit; thread.header = header; thread.header_len = header_len; Expand Down Expand Up @@ -939,7 +939,7 @@ faulthandler_register_py(PyObject *self, user->fd = fd; user->all_threads = all_threads; user->chain = chain; user->interp = tstate->interp; user->interp = PyThreadState_GetInterpreter(tstate); user->enabled = 1;
Py_RETURN_NONE; Expand Down
if (faulthandler_enable() < 0) { return NULL; Expand Down Expand Up @@ -756,7 +756,7 @@ faulthandler_dump_traceback_later(PyObject *self, /* the downcast is safe: we check that 0 < timeout_us < PY_TIMEOUT_MAX */ thread.timeout_us = (PY_TIMEOUT_T)timeout_us; thread.repeat = repeat; thread.interp = tstate->interp; thread.interp = PyThreadState_GetInterpreter(tstate); thread.exit = exit; thread.header = header; thread.header_len = header_len; Expand Down Expand Up @@ -939,7 +939,7 @@ faulthandler_register_py(PyObject *self, user->fd = fd; user->all_threads = all_threads; user->chain = chain; user->interp = tstate->interp; user->interp = PyThreadState_GetInterpreter(tstate); user->enabled = 1;
Py_RETURN_NONE; Expand Down