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):
1247
1247
self .fail (f"Unable to find home in { paths !r} " )
1248
1248
1249
1249
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 } ' )
1250
1255
expected_paths = self .module_search_paths (prefix = home , exec_prefix = home )
1251
1256
1252
1257
config = {
@@ -1257,7 +1262,7 @@ def test_init_setpythonhome(self):
1257
1262
'exec_prefix' : exec_prefix ,
1258
1263
'base_exec_prefix' : exec_prefix ,
1259
1264
'pythonpath_env' : paths_str ,
1260
- 'stdlib_dir' : home ,
1265
+ 'stdlib_dir' : stdlib ,
1261
1266
}
1262
1267
self .default_program_name (config )
1263
1268
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)
530
530
531
531
PyMem_RawFree (_Py_path_config .home );
532
532
_Py_path_config .home = _PyMem_RawWcsdup (home );
533
- if (_Py_path_config .home != NULL ) {
534
- _Py_path_config .stdlib_dir = _PyMem_RawWcsdup (home );
535
- }
536
533
537
534
PyMem_SetAllocator (PYMEM_DOMAIN_RAW , & old_alloc );
538
535
539
- if (_Py_path_config .home == NULL || _Py_path_config . stdlib_dir == NULL ) {
536
+ if (_Py_path_config .home == NULL ) {
540
537
path_out_of_memory (__func__ );
541
538
}
542
539
}
You can’t perform that action at this time.
0 commit comments