aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/rewriter.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-08-31 09:41:56 -0700
committerEli Schwartz <eschwartz93@gmail.com>2021-08-31 16:28:54 -0400
commit06fdb29daace9ebe55e5df5336f65cba304773d2 (patch)
tree1c67697fbd56686348e2096cb3b2e019a7c38892 /mesonbuild/rewriter.py
parent278942a44703aff6b643426b09a9012460719622 (diff)
downloadmeson-06fdb29daace9ebe55e5df5336f65cba304773d2.zip
meson-06fdb29daace9ebe55e5df5336f65cba304773d2.tar.gz
meson-06fdb29daace9ebe55e5df5336f65cba304773d2.tar.bz2
pylint: turn on superfluous parens warning
Which is really useful for catching parens used with keywords like assert. Don't use parens with assert, it's bad.
Diffstat (limited to 'mesonbuild/rewriter.py')
-rw-r--r--mesonbuild/rewriter.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/mesonbuild/rewriter.py b/mesonbuild/rewriter.py
index 3f661a4..d95b539 100644
--- a/mesonbuild/rewriter.py
+++ b/mesonbuild/rewriter.py
@@ -76,7 +76,7 @@ class RequiredKeys:
def __call__(self, f):
@wraps(f)
def wrapped(*wrapped_args, **wrapped_kwargs):
- assert(len(wrapped_args) >= 2)
+ assert len(wrapped_args) >= 2
cmd = wrapped_args[1]
for key, val in self.keys.items():
typ = val[0] # The type of the value
@@ -92,7 +92,7 @@ class RequiredKeys:
raise RewriterException('Invalid type of "{}". Required is {} but provided was {}'
.format(key, typ.__name__, type(cmd[key]).__name__))
if choices is not None:
- assert(isinstance(choices, list))
+ assert isinstance(choices, list)
if cmd[key] not in choices:
raise RewriterException('Invalid value of "{}": Possible values are {} but provided was "{}"'
.format(key, choices, cmd[key]))
@@ -521,8 +521,8 @@ class Rewriter:
arg_node = node.args
if not node:
mlog.error('Unable to find the function node')
- assert(isinstance(node, FunctionNode))
- assert(isinstance(arg_node, ArgumentNode))
+ assert isinstance(node, FunctionNode)
+ assert isinstance(arg_node, ArgumentNode)
# Transform the key nodes to plain strings
arg_node.kwargs = {k.value: v for k, v in arg_node.kwargs.items()}
@@ -640,7 +640,7 @@ class Rewriter:
node = target['sources'][0]
else:
node = target['node']
- assert(node is not None)
+ assert node is not None
# Generate the current source list
src_list = []
@@ -666,7 +666,7 @@ class Rewriter:
arg_node = node.args
elif isinstance(node, ArgumentNode):
arg_node = node
- assert(arg_node is not None)
+ assert arg_node is not None
arg_node.arguments += to_append
# Mark the node as modified