Skip to content

Commit 301eb7e

Browse files
authored
gh-106320: Remove _PyAnextAwaitable_Type from the public C API (#108597)
It's not needed to declare it in Include/iterobject.h: just use "extern" where it's used (only in object.c).
1 parent 39506ee commit 301eb7e

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

Include/iterobject.h

-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ extern "C" {
77

88
PyAPI_DATA(PyTypeObject) PySeqIter_Type;
99
PyAPI_DATA(PyTypeObject) PyCallIter_Type;
10-
#ifdef Py_BUILD_CORE
11-
extern PyTypeObject _PyAnextAwaitable_Type;
12-
#endif
1310

1411
#define PySeqIter_Check(op) Py_IS_TYPE((op), &PySeqIter_Type)
1512

Objects/object.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -2049,11 +2049,12 @@ _PyObject_InitState(PyInterpreterState *interp)
20492049
}
20502050

20512051

2052-
extern PyTypeObject _Py_GenericAliasIterType;
2053-
extern PyTypeObject _PyMemoryIter_Type;
2052+
extern PyTypeObject _PyAnextAwaitable_Type;
2053+
extern PyTypeObject _PyLegacyEventHandler_Type;
20542054
extern PyTypeObject _PyLineIterator;
2055+
extern PyTypeObject _PyMemoryIter_Type;
20552056
extern PyTypeObject _PyPositionsIterator;
2056-
extern PyTypeObject _PyLegacyEventHandler_Type;
2057+
extern PyTypeObject _Py_GenericAliasIterType;
20572058

20582059
static PyTypeObject* static_types[] = {
20592060
// The two most important base types: must be initialized first and

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

-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ def preprocess(filename,
6969
cwd = os.path.abspath(cwd or '.')
7070
filename = _normpath(filename, cwd)
7171

72-
print(filename)
7372
postargs = POST_ARGS
7473
if os.path.basename(filename) not in USE_LIMITED_C_API:
7574
postargs += ('-DPy_BUILD_CORE=1',)

Tools/c-analyzer/cpython/globals-to-fix.tsv

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Objects/genobject.c - _PyCoroWrapper_Type -
5757
Objects/interpreteridobject.c - PyInterpreterID_Type -
5858
Objects/iterobject.c - PyCallIter_Type -
5959
Objects/iterobject.c - PySeqIter_Type -
60+
Objects/iterobject.c - _PyAnextAwaitable_Type -
6061
Objects/listobject.c - PyListIter_Type -
6162
Objects/listobject.c - PyListRevIter_Type -
6263
Objects/listobject.c - PyList_Type -
@@ -70,6 +71,7 @@ Objects/moduleobject.c - PyModule_Type -
7071
Objects/namespaceobject.c - _PyNamespace_Type -
7172
Objects/object.c - _PyNone_Type -
7273
Objects/object.c - _PyNotImplemented_Type -
74+
Objects/object.c - _PyAnextAwaitable_Type -
7375
Objects/odictobject.c - PyODictItems_Type -
7476
Objects/odictobject.c - PyODictIter_Type -
7577
Objects/odictobject.c - PyODictKeys_Type -
@@ -113,8 +115,6 @@ Objects/codeobject.c - _PyLineIterator -
113115
Objects/codeobject.c - _PyPositionsIterator -
114116
Objects/genericaliasobject.c - _Py_GenericAliasIterType -
115117
# Not in a .h file:
116-
Objects/iterobject.c - _PyAnextAwaitable_Type -
117-
# Not in a .h file:
118118
Objects/memoryobject.c - _PyMemoryIter_Type -
119119
Objects/unicodeobject.c - _PyUnicodeASCIIIter_Type -
120120
Objects/unionobject.c - _PyUnion_Type -

0 commit comments

Comments
 (0)