diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-09-20 23:50:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-20 23:50:16 (GMT) |
commit | e267793aa4101b2771ed0e66aaff5743d23f59af (patch) | |
tree | f1378008cb479ac5d1841bc10ef2f055a5d98bf6 /Modules | |
parent | 77af2290e594479002aa7d8f914d1f38b14a4854 (diff) | |
download | cpython-e267793aa4101b2771ed0e66aaff5743d23f59af.zip cpython-e267793aa4101b2771ed0e66aaff5743d23f59af.tar.gz cpython-e267793aa4101b2771ed0e66aaff5743d23f59af.tar.bz2 |
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).
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/getpath.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/getpath.c b/Modules/getpath.c index 36f9860..3946623 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -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)); |