From d2ec81a8c99796b51fb8c49b77a7fe369863226f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 7 Feb 2020 09:17:07 +0100 Subject: bpo-39573: Add Py_SET_TYPE() function (GH-18394) Add Py_SET_TYPE() function to set the type of an object. --- Include/cpython/objimpl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Include/cpython/objimpl.h') diff --git a/Include/cpython/objimpl.h b/Include/cpython/objimpl.h index 3f148146f6..ebb3e234e3 100644 --- a/Include/cpython/objimpl.h +++ b/Include/cpython/objimpl.h @@ -15,7 +15,7 @@ static inline PyObject* _PyObject_INIT(PyObject *op, PyTypeObject *typeobj) { assert(op != NULL); - Py_TYPE(op) = typeobj; + Py_SET_TYPE(op, typeobj); if (PyType_GetFlags(typeobj) & Py_TPFLAGS_HEAPTYPE) { Py_INCREF(typeobj); } -- cgit v1.2.1