Skip to content

Commit cb6cc99

Browse files
fix compilation under ft
1 parent b874f0b commit cb6cc99

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Modules/_testcapi/object.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,9 @@ test_py_set_immortal(PyObject *self, PyObject *unused)
207207
// the object is allocated on C stack as otherwise,
208208
// it would trip the refleak checker when the object
209209
// is made immortal and leak memory
210-
PyObject object = {
211-
.ob_refcnt = 1,
212-
.ob_type = &PyBaseObject_Type,
213-
};
210+
PyObject object = {0};
211+
Py_SET_REFCNT(&object, 1);
212+
Py_SET_TYPE(&object, &PyBaseObject_Type);
214213
assert(!PyUnstable_IsImmortal(&object));
215214
PyUnstable_SetImmortal(&object);
216215
assert(PyUnstable_IsImmortal(&object));

0 commit comments

Comments
 (0)