bpo-41654: Explicitly cast PyExc_MemoryError to PyTypeObject to avoid warning (GH-22102)

This commit is contained in:
Pablo Galindo 2020-09-05 17:07:54 +01:00 committed by GitHub
parent 4ddb2d73ac
commit 6ae61959ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -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);