summaryrefslogtreecommitdiffstats
path: root/Modules/_xxsubinterpretersmodule.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-06-02 22:52:33 (GMT)
committerGitHub <noreply@github.com>2023-06-02 22:52:33 (GMT)
commite6373c0d8b59512aa7f0dea7f3fb162b6ed10fa4 (patch)
treedb75e676b44057aa1f7eed514e0395d832615fb7 /Modules/_xxsubinterpretersmodule.c
parent9ad199ba36791711f596393ca9a20dbf118ef858 (diff)
downloadcpython-e6373c0d8b59512aa7f0dea7f3fb162b6ed10fa4.zip
cpython-e6373c0d8b59512aa7f0dea7f3fb162b6ed10fa4.tar.gz
cpython-e6373c0d8b59512aa7f0dea7f3fb162b6ed10fa4.tar.bz2
gh-101524: Only Use Public C-API in the _xxsubinterpreters Module (gh-105258)
The _xxsubinterpreters module was meant to only use public API. Some internal C-API usage snuck in over the last few years (e.g. gh-28969). This fixes that.
Diffstat (limited to 'Modules/_xxsubinterpretersmodule.c')
-rw-r--r--Modules/_xxsubinterpretersmodule.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c
index d7daae2..4801f37 100644
--- a/Modules/_xxsubinterpretersmodule.c
+++ b/Modules/_xxsubinterpretersmodule.c
@@ -1,15 +1,9 @@
/* interpreters module */
/* low-level access to interpreter primitives */
-#ifndef Py_BUILD_CORE_BUILTIN
-# define Py_BUILD_CORE_MODULE 1
-#endif
#include "Python.h"
-// XXX This module should not rely on internal API.
-#include "pycore_frame.h"
-#include "pycore_pystate.h" // _PyThreadState_GET()
-#include "pycore_interpreteridobject.h"
+#include "interpreteridobject.h"
#define MODULE_NAME "_xxsubinterpreters"
@@ -376,7 +370,7 @@ _is_running(PyInterpreterState *interp)
}
assert(!PyErr_Occurred());
- _PyInterpreterFrame *frame = tstate->cframe->current_frame;
+ struct _PyInterpreterFrame *frame = tstate->cframe->current_frame;
if (frame == NULL) {
return 0;
}
@@ -512,7 +506,7 @@ interp_create(PyObject *self, PyObject *args, PyObject *kwds)
}
// Create and initialize the new interpreter.
- PyThreadState *save_tstate = _PyThreadState_GET();
+ PyThreadState *save_tstate = PyThreadState_Get();
assert(save_tstate != NULL);
const PyInterpreterConfig config = isolated
? (PyInterpreterConfig)_PyInterpreterConfig_INIT