mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
bpo-45337: Use the realpath of the new executable when creating a venv on Windows (GH-28663)
(cherry picked from commit 6811fdaec8
)
Co-authored-by: Steve Dower <steve.dower@python.org>
This commit is contained in:
parent
86bf45e69e
commit
eabca6e593
3 changed files with 29 additions and 9 deletions
|
@ -150,14 +150,20 @@ class BasicTest(BaseTest):
|
|||
def test_upgrade_dependencies(self):
|
||||
builder = venv.EnvBuilder()
|
||||
bin_path = 'Scripts' if sys.platform == 'win32' else 'bin'
|
||||
python_exe = 'python.exe' if sys.platform == 'win32' else 'python'
|
||||
python_exe = os.path.split(sys.executable)[1]
|
||||
with tempfile.TemporaryDirectory() as fake_env_dir:
|
||||
expect_exe = os.path.normcase(
|
||||
os.path.join(fake_env_dir, bin_path, python_exe)
|
||||
)
|
||||
if sys.platform == 'win32':
|
||||
expect_exe = os.path.normcase(os.path.realpath(expect_exe))
|
||||
|
||||
def pip_cmd_checker(cmd):
|
||||
cmd[0] = os.path.normcase(cmd[0])
|
||||
self.assertEqual(
|
||||
cmd,
|
||||
[
|
||||
os.path.join(fake_env_dir, bin_path, python_exe),
|
||||
expect_exe,
|
||||
'-m',
|
||||
'pip',
|
||||
'install',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue