]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-116417: Fix make check-c-globals for _testlimitedcapi (#116570)
authorVictor Stinner <vstinner@python.org>
Sun, 10 Mar 2024 20:19:47 +0000 (21:19 +0100)
committerGitHub <noreply@github.com>
Sun, 10 Mar 2024 20:19:47 +0000 (20:19 +0000)
* Remove unused '_testcapimodule' global in Modules/_testcapi/unicode.c.
* Update c-analyzer to not use the internal C API in
  _testlimitedcapi.c.

Modules/_testcapi/unicode.c
Tools/c-analyzer/c_parser/preprocessor/gcc.py
Tools/c-analyzer/cpython/ignored.tsv

index a10183dddeca98cf76fd24535091ed4472e8b059..d0954bbe36ff9df05dd215f0658f411473150abd 100644 (file)
@@ -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;
     }
index cc3a9be2104dbe84515bdbeea1eeb43f5ee4f7a4..bb5ec5ae087a749ca10c00925adc96385b496e96 100644 (file)
@@ -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',
index 0f212ecb528ac4efb7c621d40c2ebadcc09f785c..682dceaf8ae41e4764dc722dbf3940541dcf0801 100644 (file)
@@ -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  -