summaryrefslogtreecommitdiffstats
path: root/Modules/_xxinterpchannelsmodule.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-07-27 21:30:16 (GMT)
committerGitHub <noreply@github.com>2023-07-27 21:30:16 (GMT)
commit8bdae1424b54e5106782f2b9e2fadce444dc84cd (patch)
tree46aaf156abbf2f6a28235a824009365f4c53dd96 /Modules/_xxinterpchannelsmodule.c
parent75c974f5353685f338344618ad7344e64c2293d0 (diff)
downloadcpython-8bdae1424b54e5106782f2b9e2fadce444dc84cd.zip
cpython-8bdae1424b54e5106782f2b9e2fadce444dc84cd.tar.gz
cpython-8bdae1424b54e5106782f2b9e2fadce444dc84cd.tar.bz2
gh-101524: Only Use Public C-API in the _xxsubinterpreters Module (gh-107359)
The _xxsubinterpreters module should not rely on internal API. Some of the functions it uses were recently moved there however. Here we move them back (and expose them properly).
Diffstat (limited to 'Modules/_xxinterpchannelsmodule.c')
-rw-r--r--Modules/_xxinterpchannelsmodule.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/Modules/_xxinterpchannelsmodule.c b/Modules/_xxinterpchannelsmodule.c
index bdffdba..1e41841 100644
--- a/Modules/_xxinterpchannelsmodule.c
+++ b/Modules/_xxinterpchannelsmodule.c
@@ -1,13 +1,8 @@
/* interpreters module */
/* low-level access to interpreter primitives */
-#ifndef Py_BUILD_CORE_BUILTIN
-# define Py_BUILD_CORE_MODULE 1
-#endif
-
#include "Python.h"
-#include "pycore_atexit.h" // _Py_AtExit()
-#include "pycore_interp_id.h" // _PyInterpreterState_GetIDObject()
+#include "interpreteridobject.h"
/*
@@ -2140,7 +2135,7 @@ channel_list_interpreters(PyObject *self, PyObject *args, PyObject *kwds)
goto except;
}
if (res) {
- id_obj = _PyInterpreterState_GetIDObject(interp);
+ id_obj = PyInterpreterState_GetIDObject(interp);
if (id_obj == NULL) {
goto except;
}
@@ -2407,7 +2402,7 @@ module_exec(PyObject *mod)
// Make sure chnnels drop objects owned by this interpreter
PyInterpreterState *interp = _get_current_interp();
- _Py_AtExit(interp, clear_interpreter, (void *)interp);
+ PyUnstable_AtExit(interp, clear_interpreter, (void *)interp);
return 0;