]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41654: Explicitly cast PyExc_MemoryError to PyTypeObject to avoid warning (GH...
authorPablo Galindo <Pablogsal@gmail.com>
Sat, 5 Sep 2020 16:07:54 +0000 (17:07 +0100)
committerGitHub <noreply@github.com>
Sat, 5 Sep 2020 16:07:54 +0000 (17:07 +0100)
Objects/exceptions.c

index 966983810cd1e64bae1255bdd708ca2edefbd5a6..8bcf76ff860a222df7997530e7cb799fbe6dea4c 100644 (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);