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.
diff --git a/Parser/parser.c b/Parser/parser.c
index 227b918..a61b2f5 100644
--- a/Parser/parser.c
+++ b/Parser/parser.c
@@ -54,8 +54,9 @@
static void
s_pop(stack *s)
{
- if (s_empty(s))
- Py_FatalError("s_pop: parser stack underflow -- FATAL");
+ if (s_empty(s)) {
+ Py_FatalError("parser stack underflow");
+ }
s->s_top++;
}