8000 Make `MemoryError_dealloc` compatible with `destructor` · python/cpython@cc28b38 · GitHub
[go: up one dir, main page]

Skip to content

Commit cc28b38

Browse filesBrowse files
committed
Make MemoryError_dealloc compatible with destructor
1 parent cd63f58 commit cc28b38

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Objects/exceptions.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3387,8 +3387,9 @@ _PyErr_NoMemory(PyThreadState *tstate)
33873387
}
33883388

33893389
static void
3390-
MemoryError_dealloc(PyBaseExceptionObject *self)
3390+
MemoryError_dealloc(PyObject *obj)
33913391
{
3392+
PyBaseExceptionObject *self = (PyBaseExceptionObject *)obj;
33923393
_PyObject_GC_UNTRACK(self);
33933394

33943395
BaseException_clear(self);
@@ -3447,7 +3448,7 @@ PyTypeObject _PyExc_MemoryError = {
34473448
PyVarObject_HEAD_INIT(NULL, 0)
34483449
"MemoryError",
34493450
sizeof(PyBaseExceptionObject),
3450-
0, (destructor)MemoryError_dealloc, 0, 0, 0, 0, 0, 0, 0,
3451+
0, MemoryError_dealloc, 0, 0, 0, 0, 0, 0, 0,
34513452
0, 0, 0, 0, 0, 0, 0,
34523453
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
34533454
PyDoc_STR("Out of memory."), (traverseproc)BaseException_traverse,

0 commit comments

Comments
 (0)
0