summaryrefslogtreecommitdiffstats
path: root/Include
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 /Include
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 'Include')
-rw-r--r--Include/pystate.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Include/pystate.h b/Include/pystate.h
index 57dc9e4..70d3bdc 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -87,6 +87,11 @@ PyAPI_FUNC(PyThreadState *) PyThreadState_Swap(PyThreadState *);
PyAPI_FUNC(PyObject *) PyThreadState_GetDict(void);
PyAPI_FUNC(int) PyThreadState_SetAsyncExc(unsigned long, PyObject *);
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03090000
+/* New in 3.9 */
+PyAPI_FUNC(PyInterpreterState *) PyThreadState_GetInterpreter(PyThreadState *tstate);
+#endif
+
typedef
enum {PyGILState_LOCKED, PyGILState_UNLOCKED}
PyGILState_STATE;