Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit85b0b0c

Browse files
gh-103224: Use the realpath of the Python executable intest_venv (GH-103243)
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
1 parent27f9491 commit85b0b0c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎Lib/test/test_venv.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ def test_prompt(self):
208208
deftest_upgrade_dependencies(self):
209209
builder=venv.EnvBuilder()
210210
bin_path='Scripts'ifsys.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]
212213
withtempfile.TemporaryDirectory()asfake_env_dir:
213214
expect_exe=os.path.normcase(
214215
os.path.join(fake_env_dir,bin_path,python_exe)
@@ -551,7 +552,8 @@ def test_zippath_from_non_installed_posix(self):
551552
self.addCleanup(rmtree,non_installed_dir)
552553
bindir=os.path.join(non_installed_dir,self.bindir)
553554
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)
555557
libdir=os.path.join(non_installed_dir,platlibdir,self.lib[1])
556558
os.makedirs(libdir)
557559
landmark=os.path.join(libdir,"os.py")
@@ -595,7 +597,7 @@ def test_zippath_from_non_installed_posix(self):
595597
# libpython.so
596598
ld_library_path=sysconfig.get_config_var("LIBDIR")
597599
ifnotld_library_pathorsysconfig.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))
599601
ifsys.platform=='darwin':
600602
ld_library_path_env="DYLD_LIBRARY_PATH"
601603
else:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp