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.
This commit is contained in:
Victor Stinner 2020-01-27 22:37:44 +01:00 committed by GitHub
parent a94c6b61aa
commit 47ee8a6063
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View 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;
}