bpo-39882: Py_FatalError() logs the function name (GH-18819)

The Py_FatalError() function is replaced with a macro which logs
automatically the name of the current function, unless the
Py_LIMITED_API macro is defined.

Changes:

* Add _Py_FatalErrorFunc() function.
* Remove the function name from the message of Py_FatalError() calls
  which included the function name.
* Update tests.
This commit is contained in:
Victor Stinner 2020-03-07 00:54:20 +01:00 committed by GitHub
parent 7b3c252dc7
commit 9e5d30cc99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 112 additions and 69 deletions

View file

@ -21,7 +21,11 @@ PyAPI_FUNC(void) PyErr_GetExcInfo(PyObject **, PyObject **, PyObject **);
PyAPI_FUNC(void) PyErr_SetExcInfo(PyObject *, PyObject *, PyObject *);
#endif
/* Defined in Python/pylifecycle.c */
/* Defined in Python/pylifecycle.c
The Py_FatalError() function is replaced with a macro which logs
automatically the name of the current function, unless the Py_LIMITED_API
macro is defined. */
PyAPI_FUNC(void) _Py_NO_RETURN Py_FatalError(const char *message);
#if defined(Py_DEBUG) || defined(Py_LIMITED_API)