summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2022-05-19 19:23:53 (GMT)
committerGitHub <noreply@github.com>2022-05-19 19:23:53 (GMT)
commit403d16fa28764718dcd0536ccb3ab8d05768465d (patch)
treee1c8a70393a144f722945cf91e65a00b8cf7cc95 /Modules
parent3fd86100022103f41ada043f5bb5a7201e80ac27 (diff)
downloadcpython-403d16fa28764718dcd0536ccb3ab8d05768465d.zip
cpython-403d16fa28764718dcd0536ccb3ab8d05768465d.tar.gz
cpython-403d16fa28764718dcd0536ccb3ab8d05768465d.tar.bz2
gh-92913: Clarify changes to PyInitConfig.module_search_paths[_set] fields (GH-92980)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/getpath.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/getpath.py b/Modules/getpath.py
index 9aff19c..47f075c 100644
--- a/Modules/getpath.py
+++ b/Modules/getpath.py
@@ -228,6 +228,7 @@ ENV_PYTHONPATH = config['pythonpath_env']
use_environment = config.get('use_environment', 1)
pythonpath = config.get('module_search_paths')
+pythonpath_was_set = config.get('module_search_paths_set')
real_executable_dir = None
stdlib_dir = None
@@ -626,8 +627,8 @@ if py_setpath:
config['module_search_paths'] = py_setpath.split(DELIM)
config['module_search_paths_set'] = 1
-elif not pythonpath:
- # If pythonpath was already set, we leave it alone.
+elif not pythonpath_was_set:
+ # If pythonpath was already explicitly set or calculated, we leave it alone.
# This won't matter in normal use, but if an embedded host is trying to
# recalculate paths while running then we do not want to change it.
pythonpath = []