File tree Expand file tree Collapse file tree 4 files changed +21
-2
lines changed
Misc/NEWS.d/next/Core and Builtins Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change
1
+ #ifndef Py_INTERNAL_GENERICALIASOBJECT_H
2
+ #define Py_INTERNAL_GENERICALIASOBJECT_H
3
+ #ifdef __cplusplus
4
+ extern "C" {
5
+ #endif
6
+
7
+ #ifndef Py_BUILD_CORE
8
+ # error "this header requires Py_BUILD_CORE define"
9
+ #endif
10
+
11
+ extern PyTypeObject _Py_GenericAliasIterType ;
12
+
13
+ #ifdef __cplusplus
14
+ }
15
+ #endif
16
+ #endif /* !Py_INTERNAL_GENERICALIASOBJECT_H */
Original file line number Diff line number Diff line change
1
+ Fix :class: `generic_alias_iterator ` to be finalized at exit.
Original file line number Diff line number Diff line change @@ -683,7 +683,7 @@ ga_iter_clear(PyObject *self) {
683
683
return 0 ;
684
684
}
685
685
686
- static PyTypeObject Py_GenericAliasIterType = {
686
+ PyTypeObject _Py_GenericAliasIterType = {
687
687
PyVarObject_HEAD_INIT (& PyType_Type , 0 )
688
688
.tp_name = "generic_alias_iterator" ,
689
689
.tp_basicsize = sizeof (gaiterobject ),
@@ -697,7 +697,7 @@ static PyTypeObject Py_GenericAliasIterType = {
697
697
698
698
static PyObject *
699
699
ga_iter (PyObject * self ) {
700
- gaiterobject * gi = PyObject_GC_New (gaiterobject , & Py_GenericAliasIterType );
700
+ gaiterobject * gi = PyObject_GC_New (gaiterobject , & _Py_GenericAliasIterType );
701
701
if (gi == NULL ) {
702
702
return NULL ;
703
703
}
Original file line number Diff line number Diff line change 18
18
#include "pycore_unionobject.h" // _PyUnion_Type
19
19
#include "frameobject.h" // PyFrame_Type
20
20
#include "pycore_interpreteridobject.h" // _PyInterpreterID_Type
21
+ #include "pycore_genericaliasobject.h" // _Py_GenericAliasIterType
21
22
22
23
#ifdef Py_LIMITED_API
23
24
// Prevent recursive call _Py_IncRef() <=> Py_INCREF()
@@ -1923,6 +1924,7 @@ static PyTypeObject* static_types[] = {
1923
1924
& _PyAsyncGenWrappedValue_Type ,
1924
1925
& _PyContextTokenMissing_Type ,
1925
1926
& _PyCoroWrapper_Type ,
1927
+ & _Py_GenericAliasIterType ,
1926
1928
& _PyHamtItems_Type ,
1927
1929
& _PyHamtKeys_Type ,
1928
1930
& _PyHamtValues_Type ,
You can’t perform that action at this time.
0 commit comments