mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
bpo-39882: Add _Py_FatalErrorFormat() function (GH-19157)
This commit is contained in:
parent
ace018ca47
commit
87d3b9db4a
15 changed files with 158 additions and 110 deletions
|
@ -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__);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue