summaryrefslogtreecommitdiffstats
path: root/Python/pathconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pathconfig.c')
-rw-r--r--Python/pathconfig.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/Python/pathconfig.c b/Python/pathconfig.c
index 3756e3a..aa1d6f8 100644
--- a/Python/pathconfig.c
+++ b/Python/pathconfig.c
@@ -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__);
}
}