Skip to content

Commit

Permalink
ruff rule PLC0206
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Nov 25, 2024
1 parent 2ff6d36 commit 7fc90de
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
12 changes: 6 additions & 6 deletions pylib/gyp/generator/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ def __init__(self, generator_flags, flavor):
self.suffix_rules_objdir2 = {}

# Generate suffix rules for all compilable extensions.
for ext in COMPILABLE_EXTENSIONS:
for ext, value in COMPILABLE_EXTENSIONS.items():
# Suffix rules for source folder.
self.suffix_rules_srcdir.update(
{
Expand All @@ -797,7 +797,7 @@ def __init__(self, generator_flags, flavor):
$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD
\t@$(call do_cmd,%s,1)
"""
% (ext, COMPILABLE_EXTENSIONS[ext])
% (ext, value)
)
}
)
Expand All @@ -810,7 +810,7 @@ def __init__(self, generator_flags, flavor):
$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD
\t@$(call do_cmd,%s,1)
"""
% (ext, COMPILABLE_EXTENSIONS[ext])
% (ext, value)
)
}
)
Expand All @@ -821,7 +821,7 @@ def __init__(self, generator_flags, flavor):
$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
\t@$(call do_cmd,%s,1)
"""
% (ext, COMPILABLE_EXTENSIONS[ext])
% (ext, value)
)
}
)
Expand Down Expand Up @@ -1779,13 +1779,13 @@ def WriteTarget(
# using ":=".
self.WriteSortedXcodeEnv(self.output, self.GetSortedXcodePostbuildEnv())

for configname in target_postbuilds:
for configname, value in target_postbuilds.items():
self.WriteLn(
"%s: TARGET_POSTBUILDS_%s := %s"
% (
QuoteSpaces(self.output),
configname,
gyp.common.EncodePOSIXShellList(target_postbuilds[configname]),
gyp.common.EncodePOSIXShellList(value),
)
)

Expand Down
11 changes: 4 additions & 7 deletions pylib/gyp/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -2469,11 +2469,8 @@ def SetUpConfigurations(target, target_dict):
merged_configurations[configuration] = new_configuration_dict

# Put the new configurations back into the target dict as a configuration.
for configuration in merged_configurations:
target_dict["configurations"][configuration] = merged_configurations[
configuration
]

for configuration, value in merged_configurations.items():
target_dict["configurations"][configuration] = value
# Now drop all the abstract ones.
configs = target_dict["configurations"]
target_dict["configurations"] = {
Expand Down Expand Up @@ -3020,8 +3017,8 @@ def Load(
del target_dict[key]
ProcessListFiltersInDict(target_name, tmp_dict)
# Write the results back to |target_dict|.
for key in tmp_dict:
target_dict[key] = tmp_dict[key]
for key, value in tmp_dict.items():
target_dict[key] = value

# Make sure every dependency appears at most once.
RemoveDuplicateDependencies(targets)
Expand Down
4 changes: 2 additions & 2 deletions tools/pretty_sln.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ def ParseSolution(solution_file):
continue

# Change all dependencies clsid to name instead.
for project in dependencies:
for project, deps in dependencies.items():
# For each dependencies in this project
new_dep_array = []
for dep in dependencies[project]:
for dep in deps:
# Look for the project name matching this cldis
for project_info in projects:
if projects[project_info][1] == dep:
Expand Down
4 changes: 2 additions & 2 deletions tools/pretty_vcproj.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def FixFilenames(filenames, current_directory):
new_list = []
for filename in filenames:
if filename:
for key in REPLACEMENTS:
filename = filename.replace(key, REPLACEMENTS[key])
for key, value in REPLACEMENTS.items():
filename = filename.replace(key, value)
os.chdir(current_directory)
filename = filename.strip("\"' ")
if filename.startswith("$"):
Expand Down

0 comments on commit 7fc90de

Please sign in to comment.