]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-38631: Replace Py_FatalError() with _PyObject_ASSERT_FAILED_MSG() (GH-18258)
authorVictor Stinner <vstinner@python.org>
Thu, 30 Jan 2020 08:01:07 +0000 (09:01 +0100)
committerGitHub <noreply@github.com>
Thu, 30 Jan 2020 08:01:07 +0000 (09:01 +0100)
commit5eb8bff7e4aa7e4d8580a30323641388c8ff59a5
treee4bee43cdb4ce310407b9c3665cc24c015978e3c
parent188bb5b1e868eecf2342195dc45caa332ac3b6c7
bpo-38631: Replace Py_FatalError() with _PyObject_ASSERT_FAILED_MSG() (GH-18258)

Replace Py_FatalError() with _PyObject_ASSERT_FAILED_MSG() in
object.c and typeobject.c to also dump the involved Python object on
a fatal error. It should ease debug when such fatal error occurs.

If the double linked list is inconsistent, _Py_ForgetReference() no
longer dumps previous and next objects in the fatal error, it now
only dumps the current object. It ensures that the error message
is displayed even if dumping the object does crash Python.

Enhance _Py_ForgetReference() error messages;
_PyObject_ASSERT_FAILED_MSG() logs the "_Py_ForgetReference" function
name.
Objects/object.c
Objects/typeobject.c