]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106320: Remove _PyAnextAwaitable_Type from the public C API (#108597)
authorVictor Stinner <vstinner@python.org>
Tue, 29 Aug 2023 02:05:11 +0000 (04:05 +0200)
committerGitHub <noreply@github.com>
Tue, 29 Aug 2023 02:05:11 +0000 (02:05 +0000)
It's not needed to declare it in Include/iterobject.h: just use
"extern" where it's used (only in object.c).

Include/iterobject.h
Objects/object.c
Tools/c-analyzer/c_parser/preprocessor/gcc.py
Tools/c-analyzer/cpython/globals-to-fix.tsv

index fff30f7176fdeb7987bf1bec3a6391c9c4176725..e69d09719bb4d12be2e22142b35ddaf3b0afb707 100644 (file)
@@ -7,9 +7,6 @@ extern "C" {
 
 PyAPI_DATA(PyTypeObject) PySeqIter_Type;
 PyAPI_DATA(PyTypeObject) PyCallIter_Type;
-#ifdef Py_BUILD_CORE
-extern PyTypeObject _PyAnextAwaitable_Type;
-#endif
 
 #define PySeqIter_Check(op) Py_IS_TYPE((op), &PySeqIter_Type)
 
index 02e2611020983d17ac745bfdbc83e8a5596b382d..0d88421bf0fdc96abe067c57b7cf0335aafaf04d 100644 (file)
@@ -2049,11 +2049,12 @@ _PyObject_InitState(PyInterpreterState *interp)
 }
 
 
-extern PyTypeObject _Py_GenericAliasIterType;
-extern PyTypeObject _PyMemoryIter_Type;
+extern PyTypeObject _PyAnextAwaitable_Type;
+extern PyTypeObject _PyLegacyEventHandler_Type;
 extern PyTypeObject _PyLineIterator;
+extern PyTypeObject _PyMemoryIter_Type;
 extern PyTypeObject _PyPositionsIterator;
-extern PyTypeObject _PyLegacyEventHandler_Type;
+extern PyTypeObject _Py_GenericAliasIterType;
 
 static PyTypeObject* static_types[] = {
     // The two most important base types: must be initialized first and
index 55cc2d37e1ebc7c5c69fcbc224c5943d99f154d0..18d1b1a5d0a37f4e1c6a5ccf8971cc527949133c 100644 (file)
@@ -69,7 +69,6 @@ def preprocess(filename,
         cwd = os.path.abspath(cwd or '.')
     filename = _normpath(filename, cwd)
 
-    print(filename)
     postargs = POST_ARGS
     if os.path.basename(filename) not in USE_LIMITED_C_API:
         postargs += ('-DPy_BUILD_CORE=1',)
index 58f9c8e8a3e9a592f999eaface21d501771465d9..bb85fba895bc25d9a471808105c032ebc887d771 100644 (file)
@@ -57,6 +57,7 @@ Objects/genobject.c   -       _PyCoroWrapper_Type     -
 Objects/interpreteridobject.c  -       PyInterpreterID_Type    -
 Objects/iterobject.c   -       PyCallIter_Type -
 Objects/iterobject.c   -       PySeqIter_Type  -
+Objects/iterobject.c   -       _PyAnextAwaitable_Type  -
 Objects/listobject.c   -       PyListIter_Type -
 Objects/listobject.c   -       PyListRevIter_Type      -
 Objects/listobject.c   -       PyList_Type     -
@@ -70,6 +71,7 @@ Objects/moduleobject.c        -       PyModule_Type   -
 Objects/namespaceobject.c      -       _PyNamespace_Type       -
 Objects/object.c       -       _PyNone_Type    -
 Objects/object.c       -       _PyNotImplemented_Type  -
+Objects/object.c       -       _PyAnextAwaitable_Type  -
 Objects/odictobject.c  -       PyODictItems_Type       -
 Objects/odictobject.c  -       PyODictIter_Type        -
 Objects/odictobject.c  -       PyODictKeys_Type        -
@@ -113,8 +115,6 @@ Objects/codeobject.c        -       _PyLineIterator -
 Objects/codeobject.c   -       _PyPositionsIterator    -
 Objects/genericaliasobject.c   -       _Py_GenericAliasIterType        -
 # Not in a .h file:
-Objects/iterobject.c   -       _PyAnextAwaitable_Type  -
-# Not in a .h file:
 Objects/memoryobject.c -       _PyMemoryIter_Type      -
 Objects/unicodeobject.c        -       _PyUnicodeASCIIIter_Type        -
 Objects/unionobject.c  -       _PyUnion_Type   -