diff options
author | Victor Stinner <vstinner@python.org> | 2023-09-22 14:54:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-22 14:54:37 (GMT) |
commit | 09a25616a908a028b6373f9ab372d86edf064282 (patch) | |
tree | 38675294937df3ea61de15b73271ebc42339d487 /Modules/clinic | |
parent | c32abf1f21c4bd32abcefe4d601611b152568961 (diff) | |
download | cpython-09a25616a908a028b6373f9ab372d86edf064282.zip cpython-09a25616a908a028b6373f9ab372d86edf064282.tar.gz cpython-09a25616a908a028b6373f9ab372d86edf064282.tar.bz2 |
gh-109723: Disable Py_BUILD_CORE in _testcapi (#109727)
Make sure that the internal C API is not tested by mistake by
_testcapi.
Undefine Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE macros in
Modules/_testcapi/parts.h: move code from _testcapimodule.c.
heaptype_relative.c and vectorcall_limited.c are using the limited C
API which is incompatible with the internal C API.
Move test_long_numbits() from _testcapi to _testinternalcapi since it
uses the internal C API "pycore_long.h".
Fix Modules/_testcapi/pyatomic.c: don't include Python.h directly,
just include _testcapi/parts.h.
Ajust "make check-c-globals" for these changes.
Diffstat (limited to 'Modules/clinic')
-rw-r--r-- | Modules/clinic/_testinternalcapi.c.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Modules/clinic/_testinternalcapi.c.h b/Modules/clinic/_testinternalcapi.c.h index 38a3579..c1b4267 100644 --- a/Modules/clinic/_testinternalcapi.c.h +++ b/Modules/clinic/_testinternalcapi.c.h @@ -296,4 +296,21 @@ _testinternalcapi_write_unraisable_exc(PyObject *module, PyObject *const *args, exit: return return_value; } -/*[clinic end generated code: output=c7156622e80df1ce input=a9049054013a1b77]*/ + +PyDoc_STRVAR(_testinternalcapi_test_long_numbits__doc__, +"test_long_numbits($module, /)\n" +"--\n" +"\n"); + +#define _TESTINTERNALCAPI_TEST_LONG_NUMBITS_METHODDEF \ + {"test_long_numbits", (PyCFunction)_testinternalcapi_test_long_numbits, METH_NOARGS, _testinternalcapi_test_long_numbits__doc__}, + +static PyObject * +_testinternalcapi_test_long_numbits_impl(PyObject *module); + +static PyObject * +_testinternalcapi_test_long_numbits(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return _testinternalcapi_test_long_numbits_impl(module); +} +/*[clinic end generated code: output=59144f59957627bd input=a9049054013a1b77]*/ |