diff options
Diffstat (limited to 'Mac/Modules/res/_Resmodule.c')
-rw-r--r-- | Mac/Modules/res/_Resmodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Mac/Modules/res/_Resmodule.c b/Mac/Modules/res/_Resmodule.c index e34c2c5..e759269 100644 --- a/Mac/Modules/res/_Resmodule.c +++ b/Mac/Modules/res/_Resmodule.c @@ -101,7 +101,7 @@ static void ResObj_dealloc(ResourceObject *self) self->ob_freeit(self->ob_itself); } self->ob_itself = NULL; - PyObject_Del(self); + self->ob_type->tp_free((PyObject *)self); } static PyObject *ResObj_HomeResFile(ResourceObject *_self, PyObject *_args) @@ -1744,6 +1744,7 @@ void init_Res(void) PyDict_SetItemString(d, "Error", Res_Error) != 0) return; Resource_Type.ob_type = &PyType_Type; + if (PyType_Ready(&Resource_Type) < 0) return; Py_INCREF(&Resource_Type); PyModule_AddObject(m, "Resource", (PyObject *)&Resource_Type); /* Backward-compatible name */ |