Skip to content

Commit c5fa796

Browse files
authored
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.
1 parent 729bfb3 commit c5fa796

File tree

3 files changed

+1
-5
lines changed

3 files changed

+1
-5
lines changed

Modules/_testcapi/unicode.c

-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
#include "parts.h"
44
#include "util.h"
55

6-
static struct PyModuleDef *_testcapimodule = NULL; // set at initialization
7-
86
static PyObject *
97
codec_incrementalencoder(PyObject *self, PyObject *args)
108
{
@@ -2098,8 +2096,6 @@ static PyMethodDef TestMethods[] = {
20982096

20992097
int
21002098
_PyTestCapi_Init_Unicode(PyObject *m) {
2101-
_testcapimodule = PyModule_GetDef(m);
2102-
21032099
if (PyModule_AddFunctions(m, TestMethods) < 0) {
21042100
return -1;
21052101
}

Tools/c-analyzer/c_parser/preprocessor/gcc.py

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
FILES_WITHOUT_INTERNAL_CAPI = frozenset((
88
# Modules/
99
'_testcapimodule.c',
10+
'_testlimitedcapi.c',
1011
'_testclinic_limited.c',
1112
'xxlimited.c',
1213
'xxlimited_35.c',

Tools/c-analyzer/cpython/ignored.tsv

-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,6 @@ Modules/_testcapi/heaptype.c - _testcapimodule -
444444
Modules/_testcapi/mem.c - FmData -
445445
Modules/_testcapi/mem.c - FmHook -
446446
Modules/_testcapi/structmember.c - test_structmembersType_OldAPI -
447-
Modules/_testcapi/unicode.c - _testcapimodule -
448447
Modules/_testcapi/watchers.c - g_dict_watch_events -
449448
Modules/_testcapi/watchers.c - g_dict_watchers_installed -
450449
Modules/_testcapi/watchers.c - g_type_modified_events -

0 commit comments

Comments
 (0)