Skip to content

Commit 0285e1a

Browse files
Apply ruff/flake8-comprehensions rule C420 (#13284)
C420 Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead Starting with ruff 0.10.0, the above rule has been stabilized and is no longer in preview.
1 parent d97fd0b commit 0285e1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/pip/_internal/locations/_sysconfig.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ def get_scheme(
161161
scheme_name = "posix_prefix"
162162

163163
if home is not None:
164-
variables = {k: home for k in _HOME_KEYS}
164+
variables = dict.fromkeys(_HOME_KEYS, home)
165165
elif prefix is not None:
166-
variables = {k: prefix for k in _HOME_KEYS}
166+
variables = dict.fromkeys(_HOME_KEYS, prefix)
167167
else:
168168
variables = {}
169169

0 commit comments

Comments
 (0)