We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b874f0b commit cb6cc99Copy full SHA for cb6cc99
Modules/_testcapi/object.c
@@ -207,10 +207,9 @@ test_py_set_immortal(PyObject *self, PyObject *unused)
207
// the object is allocated on C stack as otherwise,
208
// it would trip the refleak checker when the object
209
// is made immortal and leak memory
210
- PyObject object = {
211
- .ob_refcnt = 1,
212
- .ob_type = &PyBaseObject_Type,
213
- };
+ PyObject object = {0};
+ Py_SET_REFCNT(&object, 1);
+ Py_SET_TYPE(&object, &PyBaseObject_Type);
214
assert(!PyUnstable_IsImmortal(&object));
215
PyUnstable_SetImmortal(&object);
216
assert(PyUnstable_IsImmortal(&object));
0 commit comments