diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-07-05 11:33:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-05 11:33:53 (GMT) |
commit | d17cc1ff9fe82b17bbe589b83e440959c8f135d7 (patch) | |
tree | f706195349a20181e79e5032925b323174153d6b | |
parent | 1f8486fd50ad4666078eb40ce9f24e8aac17a395 (diff) | |
download | cpython-d17cc1ff9fe82b17bbe589b83e440959c8f135d7.zip cpython-d17cc1ff9fe82b17bbe589b83e440959c8f135d7.tar.gz cpython-d17cc1ff9fe82b17bbe589b83e440959c8f135d7.tar.bz2 |
bpo-44562: Use PyType_GenericAlloc in Py_GenericAlias (GH-27021)
* bpo-44562: Use PyType_GenericAlloc in Py_GenericAlias
* Update Objects/genericaliasobject.c
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit b324c4c5f763c5116a97db8591e6dcb94456570a)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
-rw-r--r-- | Objects/genericaliasobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c index 48a8be1..803912b 100644 --- a/Objects/genericaliasobject.c +++ b/Objects/genericaliasobject.c @@ -646,11 +646,11 @@ PyTypeObject Py_GenericAliasType = { PyObject * Py_GenericAlias(PyObject *origin, PyObject *args) { - gaobject *alias = PyObject_GC_New(gaobject, &Py_GenericAliasType); + gaobject *alias = (gaobject*) PyType_GenericAlloc( + (PyTypeObject *)&Py_GenericAliasType, 0); if (alias == NULL) { return NULL; } - _PyObject_GC_TRACK(alias); if (!setup_ga(alias, origin, args)) { Py_DECREF(alias); return NULL; |