diff options
author | Victor Stinner <vstinner@python.org> | 2020-03-25 19:27:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-25 19:27:36 +0100 |
commit | 87d3b9db4ade1aa100ee6f065082cb7e85b8992f (patch) | |
tree | 85d17fff35bc28beb4a7c6e3a82276f2fa3760d5 /Python/pathconfig.c | |
parent | ace018ca47c03ca699603341b12781b5329d2eaa (diff) | |
download | cpython-git-87d3b9db4ade1aa100ee6f065082cb7e85b8992f.tar.gz |
bpo-39882: Add _Py_FatalErrorFormat() function (GH-19157)
Diffstat (limited to 'Python/pathconfig.c')
-rw-r--r-- | Python/pathconfig.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Python/pathconfig.c b/Python/pathconfig.c index 3756e3a9b8..aa1d6f8139 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__); } } |