mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-38234: Fix PyConfig_Read() when Py_SetPath() was called (GH-16298)
* If Py_SetPath() has been called, _PyConfig_InitPathConfig() now uses its value. * Py_Initialize() now longer copies path configuration from PyConfig to the global path configuration (_Py_path_config).
This commit is contained in:
parent
77af2290e5
commit
e267793aa4
4 changed files with 21 additions and 7 deletions
|
@ -1213,10 +1213,12 @@ calculate_path_impl(const PyConfig *config,
|
|||
"Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]\n");
|
||||
}
|
||||
|
||||
status = calculate_module_search_path(config, calculate,
|
||||
prefix, exec_prefix, pathconfig);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
if (pathconfig->module_search_path == NULL) {
|
||||
status = calculate_module_search_path(config, calculate,
|
||||
prefix, exec_prefix, pathconfig);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
status = calculate_reduce_prefix(calculate, prefix, Py_ARRAY_LENGTH(prefix));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue