diff options
author | Dong-hee Na <donghee.na@python.org> | 2022-04-20 14:10:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-20 14:10:41 (GMT) |
commit | f571c26fc1805790cacb73e70cbb0291204d41e7 (patch) | |
tree | d77bf567738a2def3efc0a8f85b7145e723cb443 /Objects/genericaliasobject.c | |
parent | f92bcfe6dea7d52dcc7077585d8818e8a0209604 (diff) | |
download | cpython-f571c26fc1805790cacb73e70cbb0291204d41e7.zip cpython-f571c26fc1805790cacb73e70cbb0291204d41e7.tar.gz cpython-f571c26fc1805790cacb73e70cbb0291204d41e7.tar.bz2 |
gh-91632: Fix generic_alias_iterator to be finalized at exit. (GH-91727)
Diffstat (limited to 'Objects/genericaliasobject.c')
-rw-r--r-- | Objects/genericaliasobject.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c index dc585de..7059c40 100644 --- a/Objects/genericaliasobject.c +++ b/Objects/genericaliasobject.c @@ -683,7 +683,9 @@ ga_iter_clear(PyObject *self) { return 0; } -static PyTypeObject Py_GenericAliasIterType = { +// gh-91632: _Py_GenericAliasIterType is exported to be cleared +// in _PyTypes_FiniTypes. +PyTypeObject _Py_GenericAliasIterType = { PyVarObject_HEAD_INIT(&PyType_Type, 0) .tp_name = "generic_alias_iterator", .tp_basicsize = sizeof(gaiterobject), @@ -697,7 +699,7 @@ static PyTypeObject Py_GenericAliasIterType = { static PyObject * ga_iter(PyObject *self) { - gaiterobject *gi = PyObject_GC_New(gaiterobject, &Py_GenericAliasIterType); + gaiterobject *gi = PyObject_GC_New(gaiterobject, &_Py_GenericAliasIterType); if (gi == NULL) { return NULL; } |