Skip to content

Commit bb46f52

Browse files
committed
Fix executable name handling and improve readability
1 parent 4123be1 commit bb46f52

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/test/test_venv.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def test_upgrade_dependencies(self):
228228
builder = venv.EnvBuilder()
229229
bin_path = 'bin'
230230
python_exe = os.path.split(sys.executable)[1]
231-
expected_exe = os.path.basename(sys.executable)
231+
expected_exe = os.path.basename(sys._base_executable)
232232

233233
if sys.platform == 'win32':
234234
bin_path = 'Scripts'
@@ -754,7 +754,8 @@ def test_zippath_from_non_installed_posix(self):
754754
subprocess.check_call(cmd, env=child_env)
755755
# Now check the venv created from the non-installed python has
756756
# correct zip path in pythonpath.
757-
cmd = [os.path.join(self.env_dir, self.bindir, python_exe), '-S', '-c', 'import sys; print(sys.path)']
757+
target_python = os.path.join(self.env_dir, self.bindir, python_exe)
758+
cmd = [target_python, '-S', '-c', 'import sys; print(sys.path)']
758759
out, err = check_output(cmd)
759760
self.assertTrue(zip_landmark.encode() in out)
760761

0 commit comments

Comments
 (0)