summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapimodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-10-17 12:30:31 (GMT)
committerGitHub <noreply@github.com>2023-10-17 12:30:31 (GMT)
commitbe5e8a010341c4d2d28ef53a1baed402ee06466e (patch)
tree6372a45676c7d5b8d07c69b67e889bbaf8f307e1 /Modules/_testcapimodule.c
parent054f496bd45cf94eac4158fd60ac95ab5f8e45c4 (diff)
downloadcpython-be5e8a010341c4d2d28ef53a1baed402ee06466e.zip
cpython-be5e8a010341c4d2d28ef53a1baed402ee06466e.tar.gz
cpython-be5e8a010341c4d2d28ef53a1baed402ee06466e.tar.bz2
gh-110964: Remove private _PyArg functions (#110966)
Move the following private functions and structures to pycore_modsupport.h internal C API: * _PyArg_BadArgument() * _PyArg_CheckPositional() * _PyArg_NoKeywords() * _PyArg_NoPositional() * _PyArg_ParseStack() * _PyArg_ParseStackAndKeywords() * _PyArg_Parser structure * _PyArg_UnpackKeywords() * _PyArg_UnpackKeywordsWithVararg() * _PyArg_UnpackStack() * _Py_ANY_VARARGS() Changes: * Python/getargs.h now includes pycore_modsupport.h to export functions. * clinic.py now adds pycore_modsupport.h when one of these functions is used. * Add pycore_modsupport.h includes when a C extension uses one of these functions. * Define Py_BUILD_CORE_MODULE in C extensions which now include directly or indirectly (via code generated by Argument Clinic) pycore_modsupport.h: * _csv * _curses_panel * _dbm * _gdbm * _multiprocessing.posixshmem * _sqlite.row * _statistics * grp * resource * syslog * _testcapi: bad_get() no longer uses METH_FASTCALL calling convention but METH_VARARGS. Replace _PyArg_UnpackStack() with PyArg_ParseTuple(). * _testcapi: add PYTESTCAPI_NEED_INTERNAL_API macro which is defined by _testcapi sub-modules which need the internal C API (pycore_modsupport.h): exceptions.c, float.c, vectorcall.c, watchers.c. * Remove Include/cpython/modsupport.h header file. Include/modsupport.h no longer includes the removed header file. * Fix mypy clinic.py
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r--Modules/_testcapimodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index c6a8dda..577fea3 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -2023,10 +2023,10 @@ test_pythread_tss_key_state(PyObject *self, PyObject *args)
return repr(self)
*/
static PyObject*
-bad_get(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+bad_get(PyObject *module, PyObject *args)
{
PyObject *self, *obj, *cls;
- if (!_PyArg_UnpackStack(args, nargs, "bad_get", 3, 3, &self, &obj, &cls)) {
+ if (!PyArg_ParseTuple(args, "OOO", &self, &obj, &cls)) {
return NULL;
}
@@ -3340,7 +3340,7 @@ static PyMethodDef TestMethods[] = {
{"W_STOPCODE", py_w_stopcode, METH_VARARGS},
#endif
{"test_pythread_tss_key_state", test_pythread_tss_key_state, METH_VARARGS},
- {"bad_get", _PyCFunction_CAST(bad_get), METH_FASTCALL},
+ {"bad_get", bad_get, METH_VARARGS},
#ifdef Py_REF_DEBUG
{"negative_refcount", negative_refcount, METH_NOARGS},
{"decref_freed_object", decref_freed_object, METH_NOARGS},