From 6f7ea0cc28c9e777c57c74b4d7c2d13604e48ba6 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 2 Sep 2022 11:52:41 -0700 Subject: pylint: enable use-sequence-for-iteration This found a couple of places where we *don't* want to use set(), and want to use list() instead. --- .pylintrc | 1 - mesonbuild/build.py | 2 +- mesonbuild/interpreter/interpreter.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.pylintrc b/.pylintrc index c185863ef..605cde2a2 100644 --- a/.pylintrc +++ b/.pylintrc @@ -88,7 +88,6 @@ disable= use-dict-literal, use-implicit-booleaness-not-comparison, use-list-literal, - use-sequence-for-iteration, used-before-assignment, useless-return, useless-super-delegation, diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 7a3bf88e0..dd5ea3c67 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -1002,7 +1002,7 @@ class BuildTarget(Target): return missing_languages def validate_sources(self): - if len(self.compilers) > 1 and any(lang in self.compilers for lang in {'cs', 'java'}): + if len(self.compilers) > 1 and any(lang in self.compilers for lang in ['cs', 'java']): langs = ', '.join(self.compilers.keys()) raise InvalidArguments(f'Cannot mix those languages into a target: {langs}') diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 3e6f3433a..1f9a99acf 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -2475,7 +2475,7 @@ class Interpreter(InterpreterBase, HoldableObject): ) def func_configure_file(self, node: mparser.BaseNode, args: T.List[TYPE_var], kwargs: kwtypes.ConfigureFile): - actions = sorted(x for x in {'configuration', 'command', 'copy'} + actions = sorted(x for x in ['configuration', 'command', 'copy'] if kwargs[x] not in [None, False]) num_actions = len(actions) if num_actions == 0: -- cgit v1.2.3