Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-41654: Explicitly cast PyExc_MemoryError to PyTypeObject to avoid…
… warning
  • Loading branch information
pablogsal committed Sep 5, 2020
commit 2a2c0500ca617fd459576d8b2a51f9e0bd04ebaf
5 changes: 3 additions & 2 deletions Objects/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -2295,8 +2295,9 @@ MemoryError_dealloc(PyBaseExceptionObject *self)
{
BaseException_clear(self);

if (Py_TYPE(self) != PyExc_MemoryError) {
return Py_TYPE(self)->tp_free((PyObject *)self);
if (Py_TYPE(self) != (PyTypeObject *)PyExc_MemoryError) {
Py_TYPE(self)->tp_free((PyObject *)self);
return;
}

_PyObject_GC_UNTRACK(self);
Expand Down