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 /Python/pathconfig.c | |
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 'Python/pathconfig.c')
-rw-r--r-- | Python/pathconfig.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/pathconfig.c b/Python/pathconfig.c index ccab832..2d00f4b 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c @@ -74,6 +74,13 @@ pathconfig_calculate(_PyPathConfig *pathconfig, const PyConfig *config) PyMemAllocatorEx old_alloc; _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + if (copy_wstr(&new_config.module_search_path, + _Py_path_config.module_search_path) < 0) + { + status = _PyStatus_NO_MEMORY(); + goto error; + } + /* Calculate program_full_path, prefix, exec_prefix, dll_path (Windows), and module_search_path */ status = _PyPathConfig_Calculate(&new_config, config); |