@@ -2282,8 +2282,8 @@ def test_remote_exec_deleted_libpython(self):
22822282 def test_remote_exec_deleted_static_executable (self ):
22832283 """Test remote exec when the target static executable was deleted."""
22842284 build_dir = sysconfig .get_config_var ('abs_builddir' )
2285- srcdir = sysconfig . get_config_var ( 'srcdir' )
2286- if not build_dir or not srcdir :
2285+ stdlib_dir = os . path . dirname ( os . path . abspath ( os . __file__ ) )
2286+ if not build_dir or not os . path . isdir ( stdlib_dir ) :
22872287 self .skipTest ('cannot determine build-tree locations' )
22882288
22892289 pybuilddir_txt = os .path .join (build_dir , 'pybuilddir.txt' )
@@ -2300,8 +2300,7 @@ def test_remote_exec_deleted_static_executable(self):
23002300 copied_build_dir = os .path .join (copied_root , 'build' )
23012301 copied_pybuilddir = os .path .join (copied_build_dir , pybuilddir )
23022302 os .makedirs (os .path .dirname (copied_pybuilddir ))
2303- os .symlink (os .path .join (srcdir , 'Lib' ),
2304- os .path .join (copied_root , 'Lib' ))
2303+ os .symlink (stdlib_dir , os .path .join (copied_root , 'Lib' ))
23052304 os .symlink (source_ext_dir , copied_pybuilddir )
23062305 shutil .copy2 (pybuilddir_txt ,
23072306 os .path .join (copied_build_dir , 'pybuilddir.txt' ))
0 commit comments