mirror of
https://github.com/python/cpython.git
synced 2025-09-12 19:57:40 +00:00
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 b324c4c5f7
)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
parent
1f8486fd50
commit
d17cc1ff9f
1 changed files with 2 additions and 2 deletions
|
@ -646,11 +646,11 @@ PyTypeObject Py_GenericAliasType = {
|
||||||
PyObject *
|
PyObject *
|
||||||
Py_GenericAlias(PyObject *origin, PyObject *args)
|
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) {
|
if (alias == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
_PyObject_GC_TRACK(alias);
|
|
||||||
if (!setup_ga(alias, origin, args)) {
|
if (!setup_ga(alias, origin, args)) {
|
||||||
Py_DECREF(alias);
|
Py_DECREF(alias);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue