From 7a9944a21253eff9b361f45a2541f69c7efb905e Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Tue, 30 Jun 2026 11:06:30 +0100 Subject: [PATCH] gh-151029: Fix deleted static executable test --- Lib/test/test_sys.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 9f686e289c8f3b..bfb21193647607 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -2282,8 +2282,8 @@ def test_remote_exec_deleted_libpython(self): def test_remote_exec_deleted_static_executable(self): """Test remote exec when the target static executable was deleted.""" build_dir = sysconfig.get_config_var('abs_builddir') - srcdir = sysconfig.get_config_var('srcdir') - if not build_dir or not srcdir: + stdlib_dir = os.path.dirname(os.__file__) + if not build_dir or not stdlib_dir: self.skipTest('cannot determine build-tree locations') pybuilddir_txt = os.path.join(build_dir, 'pybuilddir.txt') @@ -2300,8 +2300,7 @@ def test_remote_exec_deleted_static_executable(self): copied_build_dir = os.path.join(copied_root, 'build') copied_pybuilddir = os.path.join(copied_build_dir, pybuilddir) os.makedirs(os.path.dirname(copied_pybuilddir)) - os.symlink(os.path.join(srcdir, 'Lib'), - os.path.join(copied_root, 'Lib')) + os.symlink(stdlib_dir, os.path.join(copied_build_dir, 'Lib')) os.symlink(source_ext_dir, copied_pybuilddir) shutil.copy2(pybuilddir_txt, os.path.join(copied_build_dir, 'pybuilddir.txt'))