Skip to content

Commit 7b564b9

Browse files
committed
fix: use a tree symlink 2 components up
1 parent 7a55f1b commit 7b564b9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/test_venv.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,13 +822,16 @@ def test_tree_symlink(self):
822822
Test creation using a symlink to python tree.
823823
"""
824824
rmtree(self.env_dir)
825-
tree_abspath = os.path.dirname(os.path.abspath(sys.executable))
825+
executable_abspath = os.path.abspath(sys.executable)
826+
tree_abspath = os.path.dirname(
827+
os.path.dirname(executable_abspath))
826828
with tempfile.TemporaryDirectory() as symlink_dir:
827829
tree_symlink = os.path.join(
828830
os.path.realpath(symlink_dir),
829831
os.path.basename(tree_abspath))
830832
executable_symlink = os.path.join(
831833
tree_symlink,
834+
os.path.basename(os.path.dirname(executable_abspath)),
832835
os.path.basename(sys.executable))
833836
os.symlink(tree_abspath, tree_symlink)
834837
cmd = [executable_symlink, "-m", "venv", "--without-pip",

0 commit comments

Comments
 (0)