diff options
author | Victor Stinner <vstinner@python.org> | 2020-02-07 09:17:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-07 09:17:07 +0100 |
commit | d2ec81a8c99796b51fb8c49b77a7fe369863226f (patch) | |
tree | d88e7cbe89f65366d5591338fbe59a71192950db /Objects/object.c | |
parent | daa9756cb6395323d6f291efe5c7d7fdc6b2e9d8 (diff) | |
download | cpython-git-d2ec81a8c99796b51fb8c49b77a7fe369863226f.tar.gz |
bpo-39573: Add Py_SET_TYPE() function (GH-18394)
Add Py_SET_TYPE() function to set the type of an object.
Diffstat (limited to 'Objects/object.c')
-rw-r--r-- | Objects/object.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/object.c b/Objects/object.c index 5806542488..503fb86780 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -144,7 +144,7 @@ PyObject_Init(PyObject *op, PyTypeObject *tp) return PyErr_NoMemory(); } - Py_TYPE(op) = tp; + Py_SET_TYPE(op, tp); if (PyType_GetFlags(tp) & Py_TPFLAGS_HEAPTYPE) { Py_INCREF(tp); } |