Skip to content

Commit

Permalink
bpo-38631: Avoid Py_FatalError() in _memory_release() (GH-18214)
Browse files Browse the repository at this point in the history
If the export count is negative, _memory_release() now raises a
SystemError and returns -1, rather than calling Py_FatalError()
which aborts the process.
  • Loading branch information
vstinner committed Jan 27, 2020
1 parent a94c6b6 commit 47ee8a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Objects/memoryobject.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 47ee8a6

Please sign in to comment.