Skip to content

Commit 47ee8a6

Browse files
authored
bpo-38631: Avoid Py_FatalError() in _memory_release() (pythonGH-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.
1 parent a94c6b6 commit 47ee8a6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Objects/memoryobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,8 @@ _memory_release(PyMemoryViewObject *self)
10481048
return -1;
10491049
}
10501050

1051-
Py_FatalError("_memory_release(): negative export count");
1051+
PyErr_SetString(PyExc_SystemError,
1052+
"_memory_release(): negative export count");
10521053
return -1;
10531054
}
10541055

0 commit comments

Comments
 (0)