File tree 1 file changed +5
-5
lines changed
src/pip/_internal/operations/install
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -136,10 +136,10 @@ def message_about_scripts_not_on_PATH(scripts: Sequence[str]) -> Optional[str]:
136
136
return None
137
137
138
138
# Group scripts by the path they were installed in
139
- grouped_by_dir : Dict [str , Set [str ]] = collections .defaultdict (set )
139
+ grouped_by_dir : Dict [Path , Set [str ]] = collections .defaultdict (set )
140
140
for destfile in scripts :
141
- parent_dir = os . path . dirname ( destfile )
142
- script_name = os . path . basename (destfile )
141
+ parent_dir = Path ( destfile ). parent . resolve ( )
142
+ script_name = Path (destfile ). name
143
143
grouped_by_dir [parent_dir ].add (script_name )
144
144
145
145
# We don't want to warn for directories that are on PATH.
@@ -149,10 +149,10 @@ def message_about_scripts_not_on_PATH(scripts: Sequence[str]) -> Optional[str]:
149
149
# If an executable sits with sys.executable, we don't warn for it.
150
150
# This covers the case of venv invocations without activating the venv.
151
151
not_warn_dirs .append (Path (sys .executable ).parent .resolve ())
152
- warn_for : Dict [str , Set [str ]] = {
152
+ warn_for : Dict [Path , Set [str ]] = {
153
153
parent_dir : scripts
154
154
for parent_dir , scripts in grouped_by_dir .items ()
155
- if Path ( parent_dir ). resolve () not in not_warn_dirs
155
+ if parent_dir not in not_warn_dirs
156
156
}
157
157
if not warn_for :
158
158
return None
You can’t perform that action at this time.
0 commit comments