File tree 1 file changed +8
-4
lines changed
src/pip/_internal/network
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 3
3
Contains interface (MultiDomainBasicAuth) and associated glue code for
4
4
providing credentials in the context of network requests.
5
5
"""
6
+ import logging
6
7
import os
7
8
import shutil
8
9
import subprocess
@@ -169,7 +170,7 @@ def get_keyring_provider(provider: str) -> KeyRingBaseProvider:
169
170
msg = "Installed copy of keyring fails with exception %s"
170
171
if provider == "auto" :
171
172
msg = msg + ", trying to find a keyring executable as a fallback"
172
- logger .warning (msg , str ( exc ))
173
+ logger .warning (msg , exc , exc_info = logger . isEnabledFor ( logging . DEBUG ))
173
174
if provider in ["subprocess" , "auto" ]:
174
175
cli = shutil .which ("keyring" )
175
176
if cli and cli .startswith (sysconfig .get_path ("scripts" )):
@@ -188,13 +189,16 @@ def PATH_as_shutil_which_determines_it() -> str:
188
189
189
190
return path
190
191
191
- scripts = Path (sysconfig .get_path ("scripts" )). resolve ()
192
+ scripts = Path (sysconfig .get_path ("scripts" ))
192
193
193
194
paths = []
194
195
for path in PATH_as_shutil_which_determines_it ().split (os .pathsep ):
195
196
p = Path (path )
196
- if p .exists () and not p .resolve ().samefile (scripts ):
197
- paths .append (path )
197
+ try :
198
+ if not p .samefile (scripts ):
199
+ paths .append (path )
200
+ except FileNotFoundError :
201
+ pass
198
202
199
203
path = os .pathsep .join (paths )
200
204
You can’t perform that action at this time.
0 commit comments