bpo-45471: Do not set PyConfig.stdlib_dir in Py_SetPythonHome(). (gh-28954)

The change in gh-28586 (bpo-45211) should not have included code to set _Py_path_config.stdlib_dir in Py_SetPythonHome(). We fix that here.

https://bugs.python.org/issue45471
This commit is contained in:
Eric Snow 2021-10-14 14:48:32 -06:00 committed by GitHub
parent 3cc56c828d
commit 0bbea0723e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View file

@ -530,13 +530,10 @@ Py_SetPythonHome(const wchar_t *home)
PyMem_RawFree(_Py_path_config.home);
_Py_path_config.home = _PyMem_RawWcsdup(home);
if (_Py_path_config.home != NULL) {
_Py_path_config.stdlib_dir = _PyMem_RawWcsdup(home);
}
PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc);
if (_Py_path_config.home == NULL || _Py_path_config.stdlib_dir == NULL) {
if (_Py_path_config.home == NULL) {
path_out_of_memory(__func__);
}
}