From: Pablo Galindo Date: Sat, 5 Sep 2020 16:07:54 +0000 (+0100) Subject: bpo-41654: Explicitly cast PyExc_MemoryError to PyTypeObject to avoid warning (GH... X-Git-Tag: v3.8.6rc1~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6ae61959ec51a6b3dddc8e665ce6a7b8aeb26c04;p=thirdparty%2FPython%2Fcpython.git bpo-41654: Explicitly cast PyExc_MemoryError to PyTypeObject to avoid warning (GH-22102) --- diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 966983810cd1..8bcf76ff860a 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -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);