summaryrefslogtreecommitdiffstats
path: root/PC/getpathp.c
diff options
context:
space:
mode:
Diffstat (limited to 'PC/getpathp.c')
-rw-r--r--PC/getpathp.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/PC/getpathp.c b/PC/getpathp.c
index 3a0ebc1..08ed8cc 100644
--- a/PC/getpathp.c
+++ b/PC/getpathp.c
@@ -1058,38 +1058,23 @@ calculate_free(PyCalculatePath *calculate)
}
-/* Initialize paths for Py_GetPath(), Py_GetPrefix(), Py_GetExecPrefix()
- and Py_GetProgramFullPath() */
_PyInitError
-_PyPathConfig_Init(const _PyMainInterpreterConfig *main_config)
+_PyPathConfig_Calculate(_PyPathConfig *config,
+ const _PyMainInterpreterConfig *main_config)
{
- if (_Py_path_config.module_search_path) {
- /* Already initialized */
- return _Py_INIT_OK();
- }
-
- _PyInitError err;
-
PyCalculatePath calculate;
memset(&calculate, 0, sizeof(calculate));
calculate_init(&calculate, main_config);
- _PyPathConfig new_path_config;
- memset(&new_path_config, 0, sizeof(new_path_config));
-
- err = calculate_path_impl(main_config, &calculate, &new_path_config);
+ _PyInitError err = calculate_path_impl(main_config, &calculate, config);
if (_Py_INIT_FAILED(err)) {
goto done;
}
- _Py_path_config = new_path_config;
err = _Py_INIT_OK();
done:
- if (_Py_INIT_FAILED(err)) {
- _PyPathConfig_Clear(&new_path_config);
- }
calculate_free(&calculate);
return err;
}