]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-38631: Avoid Py_FatalError() in _memory_release() (GH-18214)
authorVictor Stinner <vstinner@python.org>
Mon, 27 Jan 2020 21:37:44 +0000 (22:37 +0100)
committerGitHub <noreply@github.com>
Mon, 27 Jan 2020 21:37:44 +0000 (22:37 +0100)
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

index 66920eaf947abd7bfaf5f18b5539926e55241bb2..d9dd11733ef1a15275531b280f36bd81496cf9c6 100644 (file)
@@ -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;
 }