Skip to content

Commit

Permalink
pylint: enable consider-using-dict-items
Browse files Browse the repository at this point in the history
Which found a couple of places where we could write better code.
  • Loading branch information
dcbaker authored and eli-schwartz committed Sep 20, 2022
1 parent 6d12d76 commit b11cf2f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ disable=
broad-except,
cell-var-from-loop,
consider-merging-isinstance,
consider-using-dict-items,
consider-using-f-string,
consider-using-in,
consider-using-max-builtin,
Expand Down
9 changes: 4 additions & 5 deletions mesonbuild/backend/vs2010backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1360,9 +1360,8 @@ def path_normalize_add(path, lis):
relpath = os.path.join(down, h.rel_to_builddir(self.build_to_src))
if path_normalize_add(relpath, previous_includes):
ET.SubElement(inc_hdrs, 'CLInclude', Include=relpath)
for lang in pch_sources:
h = pch_sources[lang][0]
path = os.path.join(proj_to_src_dir, h)
for headers in pch_sources.values():
path = os.path.join(proj_to_src_dir, headers[0])
if path_normalize_add(path, previous_includes):
ET.SubElement(inc_hdrs, 'CLInclude', Include=path)

Expand Down Expand Up @@ -1391,8 +1390,8 @@ def path_normalize_add(path, lis):
s = File.from_built_file(target.get_subdir(), s)
ET.SubElement(inc_cl, 'ObjectFileName').text = "$(IntDir)" + \
self.object_filename_from_source(target, s)
for lang in pch_sources:
impl = pch_sources[lang][1]
for lang, headers in pch_sources.items():
impl = headers[1]
if impl and path_normalize_add(impl, previous_sources):
inc_cl = ET.SubElement(inc_src, 'CLCompile', Include=impl)
self.create_pch(pch_sources, lang, inc_cl)
Expand Down
8 changes: 4 additions & 4 deletions mesonbuild/mintro.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,8 @@ def run(options: argparse.Namespace) -> int:
return 1

# Extract introspection information from JSON
for i in intro_types.keys():
if not intro_types[i].func:
for i, v in intro_types.items():
if not v.func:
continue
if not options.all and not getattr(options, i, False):
continue
Expand Down Expand Up @@ -549,8 +549,8 @@ def write_meson_info_file(builddata: build.Build, errors: list, build_files_upda
intro_types = get_meson_introspection_types()
intro_info = {}

for i in intro_types.keys():
if not intro_types[i].func:
for i, v in intro_types.items():
if not v.func:
continue
intro_info[i] = {
'file': f'intro-{i}.json',
Expand Down

0 comments on commit b11cf2f

Please sign in to comment.