diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2021-08-31 09:55:01 -0700 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2021-08-31 16:28:54 -0400 |
| commit | 4d7031437c7a81b52c776d4ae1e32741bdb851ca (patch) | |
| tree | 7716c4af0d3f43b450a7c94dd42ae5dbef8ebdff /mesonbuild/modules | |
| parent | 06fdb29daace9ebe55e5df5336f65cba304773d2 (diff) | |
| download | meson-4d7031437c7a81b52c776d4ae1e32741bdb851ca.tar.gz | |
pylint: turn on superflous-parens
We have a lot of these. Some of them are harmless, if unidiomatic, such
as `if (condition)`, others are potentially dangerous `assert(...)`, as
`assert(condtion)` works as expected, but `assert(condition, message)`
will result in an assertion that never triggers, as what you're actually
asserting is `bool(tuple[2])`, which will always be true.
Diffstat (limited to 'mesonbuild/modules')
| -rw-r--r-- | mesonbuild/modules/__init__.py | 2 | ||||
| -rw-r--r-- | mesonbuild/modules/cmake.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/modules/__init__.py b/mesonbuild/modules/__init__.py index 85bb99df5..652110ef3 100644 --- a/mesonbuild/modules/__init__.py +++ b/mesonbuild/modules/__init__.py @@ -187,7 +187,7 @@ def is_module_library(fname): class ModuleReturnValue: def __init__(self, return_value: T.Optional['TYPE_var'], new_objects: T.List['TYPE_var']) -> None: self.return_value = return_value - assert(isinstance(new_objects, list)) + assert isinstance(new_objects, list) self.new_objects = new_objects class GResourceTarget(build.CustomTarget): diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py index cc259dcdc..d0b60651f 100644 --- a/mesonbuild/modules/cmake.py +++ b/mesonbuild/modules/cmake.py @@ -71,8 +71,8 @@ endmacro() class CMakeSubproject(ModuleObject): def __init__(self, subp, pv): - assert(isinstance(subp, SubprojectHolder)) - assert(hasattr(subp, 'cm_interpreter')) + assert isinstance(subp, SubprojectHolder) + assert hasattr(subp, 'cm_interpreter') super().__init__() self.subp = subp self.methods.update({'get_variable': self.get_variable, @@ -96,7 +96,7 @@ class CMakeSubproject(ModuleObject): ' message(\'CMaket targets:\\n - \' + \'\\n - \'.join(<cmake_subproject>.target_list()))') # Make sure that all keys are present (if not this is a bug) - assert(all([x in res for x in ['inc', 'src', 'dep', 'tgt', 'func']])) + assert all([x in res for x in ['inc', 'src', 'dep', 'tgt', 'func']]) return res @noKwargs |
