Skip to content

Commit 8747268

Browse files
committed
Add permission check before configuration8
1 parent 05e936a commit 8747268

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pip/_internal/configuration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,8 @@ def iter_config_files(self) -> Iterable[Tuple[Kind, List[str]]]:
345345
# per-user configuration next
346346
should_load_user_config = not self.isolated and not (
347347
config_file and os.path.exists(config_file)
348-
) or not os.access(config_file[kinds.SITE], os.W_OK)
348+
) or not os.access(config_files[kinds.SITE], os.W_OK)
349+
349350
if should_load_user_config:
350351
# The legacy config file is overridden by the new config file
351352
yield kinds.USER, config_files[kinds.USER]

0 commit comments

Comments
 (0)