Skip to content

Commit f4c9ba6

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 5b964c1 commit f4c9ba6

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

pipenv/routines/shell.py

+2-7
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

@@ -60,7 +61,6 @@ def do_run(project, command, args, python=False, pypi_mirror=None):
6061
6162
Args are appended to the command in [scripts] section of project if found.
6263
"""
63-
from pathlib import Path
6464

6565
from pipenv.cmdparse import ScriptEmptyError
6666

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

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)
82+
new_path = str(virtualenv_scripts_dir(virtualenv_location))
8883

8984
# Update PATH
9085
paths = path.split(os.pathsep)

0 commit comments

Comments
 (0)