Skip to content

Commit 210a5d7

Browse files
Revert "gh-103224: Use the realpath of the Python executable in test_venv (GH-103243)" (GH-108667)
This reverts commit 85b0b0c. It broke builtbots.
1 parent 24b9bdd commit 210a5d7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Lib/test/test_venv.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,7 @@ def test_prompt(self):
208208
def test_upgrade_dependencies(self):
209209
builder = venv.EnvBuilder()
210210
bin_path = 'Scripts' if sys.platform == 'win32' else 'bin'
211-
python_exe_realpath = os.path.realpath(sys._base_executable)
212-
python_exe = os.path.split(python_exe_realpath)[1]
211+
python_exe = os.path.split(sys.executable)[1]
213212
with tempfile.TemporaryDirectory() as fake_env_dir:
214213
expect_exe = os.path.normcase(
215214
os.path.join(fake_env_dir, bin_path, python_exe)
@@ -552,8 +551,7 @@ def test_zippath_from_non_installed_posix(self):
552551
self.addCleanup(rmtree, non_installed_dir)
553552
bindir = os.path.join(non_installed_dir, self.bindir)
554553
os.mkdir(bindir)
555-
python_exe_realpath = os.path.realpath(sys._base_executable)
556-
shutil.copy2(python_exe_realpath, bindir)
554+
shutil.copy2(sys.executable, bindir)
557555
libdir = os.path.join(non_installed_dir, platlibdir, self.lib[1])
558556
os.makedirs(libdir)
559557
landmark = os.path.join(libdir, "os.py")
@@ -597,7 +595,7 @@ def test_zippath_from_non_installed_posix(self):
597595
# libpython.so
598596
ld_library_path = sysconfig.get_config_var("LIBDIR")
599597
if not ld_library_path or sysconfig.is_python_build():
600-
ld_library_path = os.path.abspath(os.path.dirname(python_exe_realpath))
598+
ld_library_path = os.path.abspath(os.path.dirname(sys.executable))
601599
if sys.platform == 'darwin':
602600
ld_library_path_env = "DYLD_LIBRARY_PATH"
603601
else:

0 commit comments

Comments
 (0)