summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-07-05 11:10:53 (GMT)
committerGitHub <noreply@github.com>2021-07-05 11:10:53 (GMT)
commitb324c4c5f763c5116a97db8591e6dcb94456570a (patch)
treef7ce2eb7b2f647a3df3cabfb0b242b3bc762a3f0 /Objects
parent09302405d22e86884d6058226790c0cdf5b72f14 (diff)
downloadcpython-b324c4c5f763c5116a97db8591e6dcb94456570a.zip
cpython-b324c4c5f763c5116a97db8591e6dcb94456570a.tar.gz
cpython-b324c4c5f763c5116a97db8591e6dcb94456570a.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>
Diffstat (limited to 'Objects')
-rw-r--r--Objects/genericaliasobject.c4
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;