File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1247,6 +1247,11 @@ def test_init_setpythonhome(self):
12471247 self .fail (f"Unable to find home in { paths !r} " )
12481248
12491249 prefix = exec_prefix = home
1250+ if MS_WINDOWS :
1251+ stdlib = os .path .join (home , sys .platlibdir )
1252+ else :
1253+ version = f'{ sys .version_info .major } .{ sys .version_info .minor } '
1254+ stdlib = os .path .join (home , sys .platlibdir , f'python{ version } ' )
12501255 expected_paths = self .module_search_paths (prefix = home , exec_prefix = home )
12511256
12521257 config = {
@@ -1257,7 +1262,7 @@ def test_init_setpythonhome(self):
12571262 'exec_prefix' : exec_prefix ,
12581263 'base_exec_prefix' : exec_prefix ,
12591264 'pythonpath_env' : paths_str ,
1260- 'stdlib_dir' : home ,
1265+ 'stdlib_dir' : stdlib ,
12611266 }
12621267 self .default_program_name (config )
12631268 env = {'TESTHOME' : home , 'PYTHONPATH' : paths_str }
Original file line number Diff line number Diff line change @@ -530,13 +530,10 @@ Py_SetPythonHome(const wchar_t *home)
530530
531531 PyMem_RawFree (_Py_path_config .home );
532532 _Py_path_config .home = _PyMem_RawWcsdup (home );
533- if (_Py_path_config .home != NULL ) {
534- _Py_path_config .stdlib_dir = _PyMem_RawWcsdup (home );
535- }
536533
537534 PyMem_SetAllocator (PYMEM_DOMAIN_RAW , & old_alloc );
538535
539- if (_Py_path_config .home == NULL || _Py_path_config . stdlib_dir == NULL ) {
536+ if (_Py_path_config .home == NULL ) {
540537 path_out_of_memory (__func__ );
541538 }
542539}
You can’t perform that action at this time.
0 commit comments