Skip to content

Commit 940be2e

Browse files
[3.14] gh-151029: Fix test_remote_exec_deleted_static_executable on static installed builds (GH-152653) (#152669)
(cherry picked from commit 03efeef) Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 589833e commit 940be2e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

Lib/test/test_sys.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,8 +2258,8 @@ def test_remote_exec_deleted_libpython(self):
22582258
def test_remote_exec_deleted_static_executable(self):
22592259
"""Test remote exec when the target static executable was deleted."""
22602260
build_dir = sysconfig.get_config_var('abs_builddir')
2261-
srcdir = sysconfig.get_config_var('srcdir')
2262-
if not build_dir or not srcdir:
2261+
stdlib_dir = os.path.dirname(os.path.abspath(os.__file__))
2262+
if not build_dir or not os.path.isdir(stdlib_dir):
22632263
self.skipTest('cannot determine build-tree locations')
22642264

22652265
pybuilddir_txt = os.path.join(build_dir, 'pybuilddir.txt')
@@ -2276,8 +2276,7 @@ def test_remote_exec_deleted_static_executable(self):
22762276
copied_build_dir = os.path.join(copied_root, 'build')
22772277
copied_pybuilddir = os.path.join(copied_build_dir, pybuilddir)
22782278
os.makedirs(os.path.dirname(copied_pybuilddir))
2279-
os.symlink(os.path.join(srcdir, 'Lib'),
2280-
os.path.join(copied_root, 'Lib'))
2279+
os.symlink(stdlib_dir, os.path.join(copied_root, 'Lib'))
22812280
os.symlink(source_ext_dir, copied_pybuilddir)
22822281
shutil.copy2(pybuilddir_txt,
22832282
os.path.join(copied_build_dir, 'pybuilddir.txt'))

0 commit comments

Comments
 (0)