From 47ee8a6063c22ec272fe7a2d95d12f7811ebb48b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 27 Jan 2020 22:37:44 +0100 Subject: [PATCH] bpo-38631: Avoid Py_FatalError() in _memory_release() (GH-18214) If the export count is negative, _memory_release() now raises a SystemError and returns -1, rather than calling Py_FatalError() which aborts the process. --- Objects/memoryobject.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index 66920eaf947..d9dd11733ef 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -1048,7 +1048,8 @@ _memory_release(PyMemoryViewObject *self) return -1; } - Py_FatalError("_memory_release(): negative export count"); + PyErr_SetString(PyExc_SystemError, + "_memory_release(): negative export count"); return -1; }