Skip to content

Commit

Permalink
Make MemoryError_dealloc compatible with destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
picnixz committed Aug 14, 2024
1 parent cd63f58 commit cc28b38
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Objects/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -3387,8 +3387,9 @@ _PyErr_NoMemory(PyThreadState *tstate)
}

static void
MemoryError_dealloc(PyBaseExceptionObject *self)
MemoryError_dealloc(PyObject *obj)
{
PyBaseExceptionObject *self = (PyBaseExceptionObject *)obj;
_PyObject_GC_UNTRACK(self);

BaseException_clear(self);
Expand Down Expand Up @@ -3447,7 +3448,7 @@ PyTypeObject _PyExc_MemoryError = {
PyVarObject_HEAD_INIT(NULL, 0)
"MemoryError",
sizeof(PyBaseExceptionObject),
0, (destructor)MemoryError_dealloc, 0, 0, 0, 0, 0, 0, 0,
0, MemoryError_dealloc, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
PyDoc_STR("Out of memory."), (traverseproc)BaseException_traverse,
Expand Down

0 comments on commit cc28b38

Please sign in to comment.