diff options
author | Victor Stinner <vstinner@python.org> | 2023-08-24 17:37:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-24 17:37:41 (GMT) |
commit | 480a337366f4a5335c599684609d5f59f27805b9 (patch) | |
tree | cb20ab981977eb1a10ee1844e5cfcfadaaeb91e2 /Modules | |
parent | aa6f787faa4bc45006da4dc2f942fb9b82c98836 (diff) | |
download | cpython-480a337366f4a5335c599684609d5f59f27805b9.zip cpython-480a337366f4a5335c599684609d5f59f27805b9.tar.gz cpython-480a337366f4a5335c599684609d5f59f27805b9.tar.bz2 |
gh-106320: Remove private _PyContext_NewHamtForTests() (#108434)
Move the function to the internal C API.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_testcapimodule.c | 8 | ||||
-rw-r--r-- | Modules/_testinternalcapi.c | 11 |
2 files changed, 10 insertions, 9 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index a7a98d1..7086d32 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -2125,13 +2125,6 @@ test_pythread_tss_key_state(PyObject *self, PyObject *args) } -static PyObject* -new_hamt(PyObject *self, PyObject *args) -{ - return _PyContext_NewHamtForTests(); -} - - /* def bad_get(self, obj, cls): cls() return repr(self) @@ -3626,7 +3619,6 @@ static PyMethodDef TestMethods[] = { {"W_STOPCODE", py_w_stopcode, METH_VARARGS}, #endif {"test_pythread_tss_key_state", test_pythread_tss_key_state, METH_VARARGS}, - {"hamt", new_hamt, METH_NOARGS}, {"bad_get", _PyCFunction_CAST(bad_get), METH_FASTCALL}, #ifdef Py_REF_DEBUG {"negative_refcount", negative_refcount, METH_NOARGS}, diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c index 7b98885..9b45d59 100644 --- a/Modules/_testinternalcapi.c +++ b/Modules/_testinternalcapi.c @@ -13,8 +13,9 @@ #include "pycore_atomic_funcs.h" // _Py_atomic_int_get() #include "pycore_bitutils.h" // _Py_bswap32() #include "pycore_bytesobject.h" // _PyBytes_Find() -#include "pycore_compile.h" // _PyCompile_CodeGen, _PyCompile_OptimizeCfg, _PyCompile_Assemble, _PyCompile_CleanDoc #include "pycore_ceval.h" // _PyEval_AddPendingCall() +#include "pycore_compile.h" // _PyCompile_CodeGen() +#include "pycore_context.h" // _PyContext_NewHamtForTests() #include "pycore_dict.h" // _PyDictOrValues_GetValues() #include "pycore_fileutils.h" // _Py_normpath() #include "pycore_frame.h" // _PyInterpreterFrame @@ -1564,6 +1565,13 @@ get_object_dict_values(PyObject *self, PyObject *obj) } +static PyObject* +new_hamt(PyObject *self, PyObject *args) +{ + return _PyContext_NewHamtForTests(); +} + + static PyMethodDef module_functions[] = { {"get_configs", get_configs, METH_NOARGS}, {"get_recursion_depth", get_recursion_depth, METH_NOARGS}, @@ -1628,6 +1636,7 @@ static PyMethodDef module_functions[] = { check_pyobject_uninitialized_is_freed, METH_NOARGS}, {"pymem_getallocatorsname", test_pymem_getallocatorsname, METH_NOARGS}, {"get_object_dict_values", get_object_dict_values, METH_O}, + {"hamt", new_hamt, METH_NOARGS}, {NULL, NULL} /* sentinel */ }; |