summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-03-16 21:45:24 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-03-16 21:45:24 (GMT)
commit861d9abfcf6a4a34790e4edc5e440a68534137e1 (patch)
treea4ea3ef14a2f0494743733b9db4079f27f5906ca /Python/pystate.c
parentc36674a2c52ecb30e180b3bcced2b8c529cf72fb (diff)
downloadcpython-861d9abfcf6a4a34790e4edc5e440a68534137e1.zip
cpython-861d9abfcf6a4a34790e4edc5e440a68534137e1.tar.gz
cpython-861d9abfcf6a4a34790e4edc5e440a68534137e1.tar.bz2
faulthandler now works in non-Python threads
Issue #26563: * Add _PyGILState_GetInterpreterStateUnsafe() function: the single PyInterpreterState used by this process' GILState implementation. * Enhance _Py_DumpTracebackThreads() to retrieve the interpreter state from autoInterpreterState in last resort. The function now accepts NULL for interp and current_tstate parameters. * test_faulthandler: fix a ResourceWarning when test is interrupted by CTRL+c
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index e8026c5..0503f32 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -714,6 +714,12 @@ _PyGILState_Init(PyInterpreterState *i, PyThreadState *t)
_PyGILState_NoteThreadState(t);
}
+PyInterpreterState *
+_PyGILState_GetInterpreterStateUnsafe(void)
+{
+ return autoInterpreterState;
+}
+
void
_PyGILState_Fini(void)
{