[Python-checkins] bpo-41654: Fix compiler warning in MemoryError_dealloc() (GH-22387)

Victor Stinner webhook-mailer at python.org
Wed Sep 23 17:25:46 EDT 2020


https://github.com/python/cpython/commit/bbeb223e9a5e9f9374df384efa386b4068a65c0e
commit: bbeb223e9a5e9f9374df384efa386b4068a65c0e
branch: master
author: Victor Stinner <vstinner at python.org>
committer: GitHub <noreply at github.com>
date: 2020-09-23T23:25:40+02:00
summary:

bpo-41654: Fix compiler warning in MemoryError_dealloc() (GH-22387)

Fix warning:

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

files:
M Objects/exceptions.c

diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index b08cbdd6aed35..b14da20db0c4e 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -2321,7 +2321,8 @@ MemoryError_dealloc(PyBaseExceptionObject *self)
     /* If this is a subclass of MemoryError, we don't need to
      * do anything in the free-list*/
     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);



More information about the Python-checkins mailing list