Skip to content

Commit 9d3cb0c

Browse files
StanFromIrelandmiss-islington
authored andcommitted
gh-151029: Fix test_remote_exec_deleted_static_executable on static installed builds (GH-152653)
(cherry picked from commit 03efeef) Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 3e286f7 commit 9d3cb0c

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
@@ -2292,8 +2292,8 @@ def test_remote_exec_deleted_libpython(self):
22922292
def test_remote_exec_deleted_static_executable(self):
22932293
"""Test remote exec when the target static executable was deleted."""
22942294
build_dir = sysconfig.get_config_var('abs_builddir')
2295-
srcdir = sysconfig.get_config_var('srcdir')
2296-
if not build_dir or not srcdir:
2295+
stdlib_dir = os.path.dirname(os.path.abspath(os.__file__))
2296+
if not build_dir or not os.path.isdir(stdlib_dir):
22972297
self.skipTest('cannot determine build-tree locations')
22982298

22992299
pybuilddir_txt = os.path.join(build_dir, 'pybuilddir.txt')
@@ -2310,8 +2310,7 @@ def test_remote_exec_deleted_static_executable(self):
23102310
copied_build_dir = os.path.join(copied_root, 'build')
23112311
copied_pybuilddir = os.path.join(copied_build_dir, pybuilddir)
23122312
os.makedirs(os.path.dirname(copied_pybuilddir))
2313-
os.symlink(os.path.join(srcdir, 'Lib'),
2314-
os.path.join(copied_root, 'Lib'))
2313+
os.symlink(stdlib_dir, os.path.join(copied_root, 'Lib'))
23152314
os.symlink(source_ext_dir, copied_pybuilddir)
23162315
shutil.copy2(pybuilddir_txt,
23172316
os.path.join(copied_build_dir, 'pybuilddir.txt'))

0 commit comments

Comments
 (0)