File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/pip/_internal/locations Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -138,17 +138,20 @@ def get_scheme(
138
138
139
139
140
140
def get_bin_prefix () -> str :
141
+ # XXX: In old virtualenv versions, sys.prefix can contain '..' components,
142
+ # so we need to call normpath to eliminate them.
143
+ prefix = os .path .normpath (sys .prefix )
141
144
if WINDOWS :
142
- bin_py = os .path .join (sys . prefix , "Scripts" )
145
+ bin_py = os .path .join (prefix , "Scripts" )
143
146
# buildout uses 'bin' on Windows too?
144
147
if not os .path .exists (bin_py ):
145
- bin_py = os .path .join (sys . prefix , "bin" )
148
+ bin_py = os .path .join (prefix , "bin" )
146
149
return bin_py
147
150
# Forcing to use /usr/local/bin for standard macOS framework installs
148
151
# Also log to ~/Library/Logs/ for use with the Console.app log viewer
149
- if sys .platform [:6 ] == "darwin" and sys . prefix [:16 ] == "/System/Library/" :
152
+ if sys .platform [:6 ] == "darwin" and prefix [:16 ] == "/System/Library/" :
150
153
return "/usr/local/bin"
151
- return os .path .join (sys . prefix , "bin" )
154
+ return os .path .join (prefix , "bin" )
152
155
153
156
154
157
def get_purelib () -> str :
You can’t perform that action at this time.
0 commit comments