Skip to content

Commit 6ae6195

Browse files
authored
bpo-41654: Explicitly cast PyExc_MemoryError to PyTypeObject to avoid warning (pythonGH-22102)
1 parent 4ddb2d7 commit 6ae6195

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Objects/exceptions.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -2295,8 +2295,9 @@ MemoryError_dealloc(PyBaseExceptionObject *self)
22952295
{
22962296
BaseException_clear(self);
22972297

2298-
if (Py_TYPE(self) != PyExc_MemoryError) {
2299-
return Py_TYPE(self)->tp_free((PyObject *)self);
2298+
if (Py_TYPE(self) != (PyTypeObject *)PyExc_MemoryError) {
2299+
Py_TYPE(self)->tp_free((PyObject *)self);
2300+
return;
23002301
}
23012302

23022303
_PyObject_GC_UNTRACK(self);

0 commit comments

Comments
 (0)