diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-09-21 00:13:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-21 00:13:14 (GMT) |
commit | 9f3dcf802eefeb5ab821ce3c7204ab46557d53d7 (patch) | |
tree | d1e7b26a770e63c9654a3596d0080790ec732eec /Modules | |
parent | 245d439320e0921459502883fe809213e3b93e35 (diff) | |
download | cpython-9f3dcf802eefeb5ab821ce3c7204ab46557d53d7.zip cpython-9f3dcf802eefeb5ab821ce3c7204ab46557d53d7.tar.gz cpython-9f3dcf802eefeb5ab821ce3c7204ab46557d53d7.tar.bz2 |
[3.8] bpo-38234: Fix PyConfig_Read() when Py_SetPath() was called (GH-16298) (GH-16313)
* bpo-38234: Remove _PyPathConfig.dll_path (GH-16307)
The DLL path is not computed from any user configuration and cannot
be configured by PyConfig. Instead, add a new _Py_dll_path global variable.
Remove _PyConfig_SetPathConfig(): replaced with _PyPathConfig_Init().
Py_Initialize() now longer sets the "global path configuration",
but only initialize _Py_dll_path.
(cherry picked from commit c422167749f92d4170203e996a2c619c818335ea)
* 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).
(cherry picked from commit e267793aa4101b2771ed0e66aaff5743d23f59af)
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 dc05748..5afb5b1 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)); |