bpo-32030: Move PYTHONPATH to _PyMainInterpreterConfig (#4511)

Move _PyCoreConfig.module_search_path_env to _PyMainInterpreterConfig
structure.
This commit is contained in:
Victor Stinner 2017-11-23 01:49:45 +01:00 committed by GitHub
parent 0784a2e5b1
commit e32e79f7d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 29 deletions

View file

@ -624,7 +624,7 @@ error:
static void
calculate_path(_PyCoreConfig *core_config)
calculate_path(_PyMainInterpreterConfig *config)
{
wchar_t argv0_path[MAXPATHLEN+1];
wchar_t *buf;
@ -637,8 +637,8 @@ calculate_path(_PyCoreConfig *core_config)
wchar_t *userpath = NULL;
wchar_t zip_path[MAXPATHLEN+1];
if (core_config) {
envpath = core_config->module_search_path_env;
if (config) {
envpath = config->module_search_path_env;
}
else if (!Py_IgnoreEnvironmentFlag) {
envpath = _wgetenv(L"PYTHONPATH");
@ -899,10 +899,10 @@ Py_SetPath(const wchar_t *path)
}
wchar_t *
_Py_GetPathWithConfig(_PyCoreConfig *core_config)
_Py_GetPathWithConfig(_PyMainInterpreterConfig *config)
{
if (!module_search_path) {
calculate_path(core_config);
calculate_path(config);
}
return module_search_path;
}