Skip to content

Commit c3f5b44

Browse files
committed
refactor(routines): set up dynamic scripts location lookup
Removed custom logic for determining the scripts/ location, in favor of using the virtualenv mechanism. Fixes: #5978
1 parent b5f56a0 commit c3f5b44

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pipenv/routines/shell.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from pipenv.utils.project import ensure_project
77
from pipenv.utils.shell import cmd_list_to_shell, system_which
8+
from pipenv.utils.virtualenv import virtualenv_scripts_dir
89
from pipenv.vendor import click
910

1011

@@ -79,12 +80,7 @@ def do_run(project, command, args, python=False, pypi_mirror=None):
7980
# Get the exact string representation of virtualenv_location
8081
virtualenv_location = str(project.virtualenv_location)
8182

82-
# Use pathlib for path construction but convert back to string
83-
from pathlib import Path
84-
85-
virtualenv_path = Path(virtualenv_location)
86-
bin_dir = "Scripts" if os.name == "nt" else "bin"
87-
new_path = str(virtualenv_path / bin_dir)
83+
new_path = str(virtualenv_scripts_dir(virtualenv_location))
8884

8985
# Update PATH
9086
paths = path.split(os.pathsep)

0 commit comments

Comments
 (0)