File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,15 @@ def site_config_dirs(appname: str) -> list[str]:
4444 dirval = _appdirs .site_data_dir (appname , appauthor = False , multipath = True )
4545 return dirval .split (os .pathsep )
4646
47- dirval = _appdirs .site_config_dir (appname , appauthor = False , multipath = True )
4847 if sys .platform == "win32" :
49- return [dirval ]
48+ try :
49+ # Causes FileNotFoundError on attempt to access a registry key that does
50+ # not exist. This should not break apart pip configuration loading.
51+ dirval = _appdirs .site_config_dir (appname , appauthor = False , multipath = True )
52+ return [dirval ]
53+ except FileNotFoundError :
54+ return []
5055
5156 # Unix-y system. Look in /etc as well.
57+ dirval = _appdirs .site_config_dir (appname , appauthor = False , multipath = True )
5258 return dirval .split (os .pathsep ) + ["/etc" ]
You can’t perform that action at this time.
0 commit comments