]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41654: Fix compiler warning in MemoryError_dealloc() (GH-22387) (GH-24894)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 16 Mar 2021 17:36:41 +0000 (10:36 -0700)
committerGitHub <noreply@github.com>
Tue, 16 Mar 2021 17:36:41 +0000 (18:36 +0100)
Fix warning:

Objects\exceptions.c(2324,56): warning C4098:
'MemoryError_dealloc': 'void' function returning a value
(cherry picked from commit bbeb223e9a5e9f9374df384efa386b4068a65c0e)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Objects/exceptions.c

index eb72de53e98c12bea83f5f4c7924aa5d0ed46ac2..e67ecfab858fba06f830411d891b08864dd27cdd 100644 (file)
@@ -2310,7 +2310,8 @@ MemoryError_dealloc(PyBaseExceptionObject *self)
     BaseException_clear(self);
 
     if (!Py_IS_TYPE(self, (PyTypeObject *) PyExc_MemoryError)) {
-        return Py_TYPE(self)->tp_free((PyObject *)self);
+        Py_TYPE(self)->tp_free((PyObject *)self);
+        return;
     }
 
     _PyObject_GC_UNTRACK(self);