summaryrefslogtreecommitdiff
path: root/Python/pystate.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 28c5578664..f92c2b4c5e 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -998,6 +998,17 @@ PyThreadState_GetDict(void)
}
+PyInterpreterState *
+PyThreadState_GetInterpreter(PyThreadState *tstate)
+{
+ assert(tstate != NULL);
+ if (tstate == NULL) {
+ return NULL;
+ }
+ return tstate->interp;
+}
+
+
/* Asynchronously raise an exception in a thread.
Requested by Just van Rossum and Alex Martelli.
To prevent naive misuse, you must write your own extension