summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapimodule.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2024-03-21 15:56:12 (GMT)
committerGitHub <noreply@github.com>2024-03-21 15:56:12 (GMT)
commitbbee57fa8c318cb26d6c8651254927a1972c9738 (patch)
tree244201e644486b2b5b241e6e40918dd390013027 /Modules/_testcapimodule.c
parente728303532168efab7694c55c82ea19b18bf8385 (diff)
downloadcpython-bbee57fa8c318cb26d6c8651254927a1972c9738.zip
cpython-bbee57fa8c318cb26d6c8651254927a1972c9738.tar.gz
cpython-bbee57fa8c318cb26d6c8651254927a1972c9738.tar.bz2
gh-76785: Clean Up Interpreter ID Conversions (gh-117048)
Mostly we unify the two different implementations of the conversion code (from PyObject * to int64_t. We also drop the PyArg_ParseTuple()-style converter function, as well as rename and move PyInterpreterID_LookUp().
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r--Modules/_testcapimodule.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index b73085b..e68d083 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -1455,30 +1455,6 @@ get_interpreterid_type(PyObject *self, PyObject *Py_UNUSED(ignored))
return Py_NewRef(&PyInterpreterID_Type);
}
-static PyObject *
-link_interpreter_refcount(PyObject *self, PyObject *idobj)
-{
- PyInterpreterState *interp = PyInterpreterID_LookUp(idobj);
- if (interp == NULL) {
- assert(PyErr_Occurred());
- return NULL;
- }
- _PyInterpreterState_RequireIDRef(interp, 1);
- Py_RETURN_NONE;
-}
-
-static PyObject *
-unlink_interpreter_refcount(PyObject *self, PyObject *idobj)
-{
- PyInterpreterState *interp = PyInterpreterID_LookUp(idobj);
- if (interp == NULL) {
- assert(PyErr_Occurred());
- return NULL;
- }
- _PyInterpreterState_RequireIDRef(interp, 0);
- Py_RETURN_NONE;
-}
-
static PyMethodDef ml;
static PyObject *
@@ -3324,8 +3300,6 @@ static PyMethodDef TestMethods[] = {
{"test_current_tstate_matches", test_current_tstate_matches, METH_NOARGS},
{"run_in_subinterp", run_in_subinterp, METH_VARARGS},
{"get_interpreterid_type", get_interpreterid_type, METH_NOARGS},
- {"link_interpreter_refcount", link_interpreter_refcount, METH_O},
- {"unlink_interpreter_refcount", unlink_interpreter_refcount, METH_O},
{"create_cfunction", create_cfunction, METH_NOARGS},
{"call_in_temporary_c_thread", call_in_temporary_c_thread, METH_VARARGS,
PyDoc_STR("set_error_class(error_class) -> None")},