mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
gh-92913: Clarify changes to PyInitConfig.module_search_paths[_set] fields (GH-92980)
(cherry picked from commit 403d16fa28)
Co-authored-by: Steve Dower <steve.dower@python.org>
This commit is contained in:
parent
57d7ddd607
commit
4eb2f40756
5 changed files with 39 additions and 8 deletions
|
|
@ -228,6 +228,7 @@ def search_up(prefix, *landmarks, test=isfile):
|
|||
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 @@ def search_up(prefix, *landmarks, test=isfile):
|
|||
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 = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue