mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-42260: Fix _PyConfig_Read() if compute_path_config=0 (GH-23220)
Fix _PyConfig_Read() if compute_path_config=0: use values set by Py_SetPath(), Py_SetPythonHome() and Py_SetProgramName(). Add compute_path_config parameter to _PyConfig_InitPathConfig(). The following functions now return NULL if called before Py_Initialize(): * Py_GetExecPrefix() * Py_GetPath() * Py_GetPrefix() * Py_GetProgramFullPath() * Py_GetProgramName() * Py_GetPythonHome() These functions no longer automatically computes the Python Path Configuration. Moreover, Py_SetPath() no longer computes program_full_path.
This commit is contained in:
parent
1e996c3a3b
commit
ace3f9a0ce
8 changed files with 93 additions and 95 deletions
|
@ -2069,8 +2069,8 @@ config_read(PyConfig *config, int compute_path_config)
|
|||
}
|
||||
}
|
||||
|
||||
if (compute_path_config && config->_install_importlib) {
|
||||
status = _PyConfig_InitPathConfig(config);
|
||||
if (config->_install_importlib) {
|
||||
status = _PyConfig_InitPathConfig(config, compute_path_config);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue