diff options
author | Victor Stinner <vstinner@python.org> | 2024-03-10 21:19:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-10 20:19:47 +0000 |
commit | c5fa796619a8cae5a1a8a4a043d05a99adec713d (patch) | |
tree | 246bac2231b8beb34749aa980fef592422c47799 | |
parent | gh-116417: Avoid PyFloat_AS_DOUBLE() in AC limited C API (#116568) (diff) | |
download | cpython-c5fa796619a8cae5a1a8a4a043d05a99adec713d.tar.gz cpython-c5fa796619a8cae5a1a8a4a043d05a99adec713d.tar.bz2 cpython-c5fa796619a8cae5a1a8a4a043d05a99adec713d.zip |
gh-116417: Fix make check-c-globals for _testlimitedcapi (#116570)
* Remove unused '_testcapimodule' global in Modules/_testcapi/unicode.c.
* Update c-analyzer to not use the internal C API in
_testlimitedcapi.c.
-rw-r--r-- | Modules/_testcapi/unicode.c | 4 | ||||
-rw-r--r-- | Tools/c-analyzer/c_parser/preprocessor/gcc.py | 1 | ||||
-rw-r--r-- | Tools/c-analyzer/cpython/ignored.tsv | 1 |
3 files changed, 1 insertions, 5 deletions
diff --git a/Modules/_testcapi/unicode.c b/Modules/_testcapi/unicode.c index a10183dddec..d0954bbe36f 100644 --- a/Modules/_testcapi/unicode.c +++ b/Modules/_testcapi/unicode.c @@ -3,8 +3,6 @@ #include "parts.h" #include "util.h" -static struct PyModuleDef *_testcapimodule = NULL; // set at initialization - static PyObject * codec_incrementalencoder(PyObject *self, PyObject *args) { @@ -2098,8 +2096,6 @@ static PyMethodDef TestMethods[] = { int _PyTestCapi_Init_Unicode(PyObject *m) { - _testcapimodule = PyModule_GetDef(m); - if (PyModule_AddFunctions(m, TestMethods) < 0) { return -1; } diff --git a/Tools/c-analyzer/c_parser/preprocessor/gcc.py b/Tools/c-analyzer/c_parser/preprocessor/gcc.py index cc3a9be2104..bb5ec5ae087 100644 --- a/Tools/c-analyzer/c_parser/preprocessor/gcc.py +++ b/Tools/c-analyzer/c_parser/preprocessor/gcc.py @@ -7,6 +7,7 @@ from . import common as _common FILES_WITHOUT_INTERNAL_CAPI = frozenset(( # Modules/ '_testcapimodule.c', + '_testlimitedcapi.c', '_testclinic_limited.c', 'xxlimited.c', 'xxlimited_35.c', diff --git a/Tools/c-analyzer/cpython/ignored.tsv b/Tools/c-analyzer/cpython/ignored.tsv index 0f212ecb528..682dceaf8ae 100644 --- a/Tools/c-analyzer/cpython/ignored.tsv +++ b/Tools/c-analyzer/cpython/ignored.tsv @@ -444,7 +444,6 @@ Modules/_testcapi/heaptype.c - _testcapimodule - Modules/_testcapi/mem.c - FmData - Modules/_testcapi/mem.c - FmHook - Modules/_testcapi/structmember.c - test_structmembersType_OldAPI - -Modules/_testcapi/unicode.c - _testcapimodule - Modules/_testcapi/watchers.c - g_dict_watch_events - Modules/_testcapi/watchers.c - g_dict_watchers_installed - Modules/_testcapi/watchers.c - g_type_modified_events - |