summaryrefslogtreecommitdiff
path: root/PC
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-09-21 01:50:16 +0200
committerGitHub <noreply@github.com>2019-09-21 01:50:16 +0200
commite267793aa4101b2771ed0e66aaff5743d23f59af (patch)
treef1378008cb479ac5d1841bc10ef2f055a5d98bf6 /PC
parent77af2290e594479002aa7d8f914d1f38b14a4854 (diff)
downloadcpython-git-e267793aa4101b2771ed0e66aaff5743d23f59af.tar.gz
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 'PC')
-rw-r--r--PC/getpathp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/PC/getpathp.c b/PC/getpathp.c
index 01455a660b..0ee53080bf 100644
--- a/PC/getpathp.c
+++ b/PC/getpathp.c
@@ -1003,9 +1003,12 @@ calculate_path_impl(const PyConfig *config,
calculate_home_prefix(calculate, prefix);
- status = calculate_module_search_path(config, calculate, pathconfig, prefix);
- if (_PyStatus_EXCEPTION(status)) {
- return status;
+ if (pathconfig->module_search_path == NULL) {
+ status = calculate_module_search_path(config, calculate,
+ pathconfig, prefix);
+ if (_PyStatus_EXCEPTION(status)) {
+ return status;
+ }
}
done: