mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-92913: Clarify changes to PyInitConfig.module_search_paths[_set] fields (GH-92980)
This commit is contained in:
parent
3fd8610002
commit
403d16fa28
5 changed files with 39 additions and 8 deletions
|
@ -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 = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue