@@ -208,7 +208,8 @@ def test_prompt(self):
208
208
def test_upgrade_dependencies (self ):
209
209
builder = venv .EnvBuilder ()
210
210
bin_path = 'Scripts' if sys .platform == 'win32' else 'bin'
211
- python_exe = os .path .split (sys .executable )[1 ]
211
+ python_exe_realpath = os .path .realpath (sys ._base_executable )
212
+ python_exe = os .path .split (python_exe_realpath )[1 ]
212
213
with tempfile .TemporaryDirectory () as fake_env_dir :
213
214
expect_exe = os .path .normcase (
214
215
os .path .join (fake_env_dir , bin_path , python_exe )
@@ -551,7 +552,8 @@ def test_zippath_from_non_installed_posix(self):
551
552
self .addCleanup (rmtree , non_installed_dir )
552
553
bindir = os .path .join (non_installed_dir , self .bindir )
553
554
os .mkdir (bindir )
554
- shutil .copy2 (sys .executable , bindir )
555
+ python_exe_realpath = os .path .realpath (sys ._base_executable )
556
+ shutil .copy2 (python_exe_realpath , bindir )
555
557
libdir = os .path .join (non_installed_dir , platlibdir , self .lib [1 ])
556
558
os .makedirs (libdir )
557
559
landmark = os .path .join (libdir , "os.py" )
@@ -595,7 +597,7 @@ def test_zippath_from_non_installed_posix(self):
595
597
# libpython.so
596
598
ld_library_path = sysconfig .get_config_var ("LIBDIR" )
597
599
if not ld_library_path or sysconfig .is_python_build ():
598
- ld_library_path = os .path .abspath (os .path .dirname (sys . executable ))
600
+ ld_library_path = os .path .abspath (os .path .dirname (python_exe_realpath ))
599
601
if sys .platform == 'darwin' :
600
602
ld_library_path_env = "DYLD_LIBRARY_PATH"
601
603
else :
0 commit comments