mirror of
https://github.com/python/cpython.git
synced 2025-10-03 13:45:29 +00:00
Revert "bpo-44562: Remove invalid PyObject_GC_Del from error path of types.GenericAlias … (GH-27016) (GH-27018)" (GH-27022)
This reverts commit 4684a34c8d
.
This commit is contained in:
parent
4684a34c8d
commit
fe847a6285
2 changed files with 3 additions and 5 deletions
|
@ -1,2 +0,0 @@
|
||||||
Remove uses of :c:func:`PyObject_GC_Del` in error path when initializing
|
|
||||||
:class:`types.GenericAlias`.
|
|
|
@ -602,7 +602,7 @@ ga_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (!setup_ga(self, origin, arguments)) {
|
if (!setup_ga(self, origin, arguments)) {
|
||||||
Py_DECREF(self);
|
type->tp_free((PyObject *)self);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return (PyObject *)self;
|
return (PyObject *)self;
|
||||||
|
@ -644,10 +644,10 @@ Py_GenericAlias(PyObject *origin, PyObject *args)
|
||||||
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);
|
PyObject_GC_Del((PyObject *)alias);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
_PyObject_GC_TRACK(alias);
|
||||||
return (PyObject *)alias;
|
return (PyObject *)alias;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue