bpo-35810: Incref heap-allocated types in PyObject_Init (GH-11661)

* Incref heap-allocated types in PyObject_Init
* Add documentation and porting notes to What's New
This commit is contained in:
Eddie Elizondo 2019-03-27 07:52:18 -04:00 committed by Petr Viktorin
parent 1fc5bf2ff2
commit 364f0b0f19
8 changed files with 89 additions and 10 deletions

View file

@ -987,9 +987,6 @@ PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
memset(obj, '\0', size);
if (type->tp_flags & Py_TPFLAGS_HEAPTYPE)
Py_INCREF(type);
if (type->tp_itemsize == 0)
(void)PyObject_INIT(obj, type);
else