mirror of
https://github.com/python/cpython.git
synced 2025-07-12 05:45:15 +00:00
bpo-39573: Add Py_SET_TYPE() function (GH-18394)
Add Py_SET_TYPE() function to set the type of an object.
This commit is contained in:
parent
daa9756cb6
commit
d2ec81a8c9
24 changed files with 77 additions and 48 deletions
|
@ -52,7 +52,7 @@ PyModuleDef_Init(struct PyModuleDef* def)
|
|||
if (def->m_base.m_index == 0) {
|
||||
max_module_number++;
|
||||
Py_SET_REFCNT(def, 1);
|
||||
Py_TYPE(def) = &PyModuleDef_Type;
|
||||
Py_SET_TYPE(def, &PyModuleDef_Type);
|
||||
def->m_base.m_index = max_module_number;
|
||||
}
|
||||
return (PyObject*)def;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue