bpo-39882: Add _Py_FatalErrorFormat() function (GH-19157)

This commit is contained in:
Victor Stinner 2020-03-25 19:27:36 +01:00 committed by GitHub
parent ace018ca47
commit 87d3b9db4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 158 additions and 110 deletions

View file

@ -484,6 +484,12 @@ pathconfig_global_init(void)
/* External interface */
static void _Py_NO_RETURN
path_out_of_memory(const char *func)
{
_Py_FatalErrorFunc(func, "out of memory");
}
void
Py_SetPath(const wchar_t *path)
{
@ -515,7 +521,7 @@ Py_SetPath(const wchar_t *path)
|| _Py_path_config.exec_prefix == NULL
|| _Py_path_config.module_search_path == NULL)
{
Py_FatalError("out of memory");
path_out_of_memory(__func__);
}
}
@ -536,7 +542,7 @@ Py_SetPythonHome(const wchar_t *home)
PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc);
if (_Py_path_config.home == NULL) {
Py_FatalError("out of memory");
path_out_of_memory(__func__);
}
}
@ -557,7 +563,7 @@ Py_SetProgramName(const wchar_t *program_name)
PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc);
if (_Py_path_config.program_name == NULL) {
Py_FatalError("out of memory");
path_out_of_memory(__func__);
}
}
@ -577,7 +583,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("out of memory");
path_out_of_memory(__func__);
}
}