mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
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:
parent
7b3c252dc7
commit
9e5d30cc99
17 changed files with 112 additions and 69 deletions
|
@ -515,7 +515,7 @@ Py_SetPath(const wchar_t *path)
|
|||
|| _Py_path_config.exec_prefix == NULL
|
||||
|| _Py_path_config.module_search_path == NULL)
|
||||
{
|
||||
Py_FatalError("Py_SetPath() failed: out of memory");
|
||||
Py_FatalError("out of memory");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -536,7 +536,7 @@ Py_SetPythonHome(const wchar_t *home)
|
|||
PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc);
|
||||
|
||||
if (_Py_path_config.home == NULL) {
|
||||
Py_FatalError("Py_SetPythonHome() failed: out of memory");
|
||||
Py_FatalError("out of memory");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -557,7 +557,7 @@ Py_SetProgramName(const wchar_t *program_name)
|
|||
PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc);
|
||||
|
||||
if (_Py_path_config.program_name == NULL) {
|
||||
Py_FatalError("Py_SetProgramName() failed: out of memory");
|
||||
Py_FatalError("out of memory");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -577,7 +577,7 @@ _Py_SetProgramFullPath(const wchar_t *program_full_path)
|
|||
PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc);
|
||||
|
||||
if (_Py_path_config.program_full_path == NULL) {
|
||||
Py_FatalError("_Py_SetProgramFullPath() failed: out of memory");
|
||||
Py_FatalError("out of memory");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue