summaryrefslogtreecommitdiffstats
path: root/Modules/faulthandler.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-13 22:38:08 (GMT)
committerGitHub <noreply@github.com>2020-03-13 22:38:08 (GMT)
commit8fb02b6e1942811c8d81041e7df3f5f1f4b1d410 (patch)
tree3aa66f0f66f706d076cacd4f207039bdca5675bb /Modules/faulthandler.c
parentbe79373a78c0d75fc715ab64253c9b757987a848 (diff)
downloadcpython-8fb02b6e1942811c8d81041e7df3f5f1f4b1d410.zip
cpython-8fb02b6e1942811c8d81041e7df3f5f1f4b1d410.tar.gz
cpython-8fb02b6e1942811c8d81041e7df3f5f1f4b1d410.tar.bz2
bpo-39947: Add PyThreadState_GetInterpreter() (GH-18981)
Add PyThreadState_GetInterpreter(tstate): get the interpreter of a Python thread state.
Diffstat (limited to 'Modules/faulthandler.c')
-rw-r--r--Modules/faulthandler.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index 555e1af..ba88d98 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -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;
@@ -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;
@@ -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;