diff options
-rw-r--r-- | .pylintrc | 1 | ||||
-rw-r--r-- | mesonbuild/mdist.py | 4 | ||||
-rw-r--r-- | mesonbuild/rewriter.py | 12 |
3 files changed, 9 insertions, 8 deletions
@@ -22,6 +22,7 @@ enable= no-value-for-parameter, redundant-keyword-arg, singleton-comparison, + superfluous-parens, too-many-function-args, unexpected-keyword-arg, unneeded-not, diff --git a/mesonbuild/mdist.py b/mesonbuild/mdist.py index afa1b4c..f1040e9 100644 --- a/mesonbuild/mdist.py +++ b/mesonbuild/mdist.py @@ -83,7 +83,7 @@ def process_submodules(dirname): def run_dist_scripts(src_root, bld_root, dist_root, dist_scripts, subprojects): - assert(os.path.isabs(dist_root)) + assert os.path.isabs(dist_root) env = {} env['MESON_DIST_ROOT'] = dist_root env['MESON_SOURCE_ROOT'] = src_root @@ -243,7 +243,7 @@ def check_dist(packagename, meson_command, extra_meson_args, bld_root, privdir): ninja_args = detect_ninja() shutil.unpack_archive(packagename, unpackdir) unpacked_files = glob(os.path.join(unpackdir, '*')) - assert(len(unpacked_files) == 1) + assert len(unpacked_files) == 1 unpacked_src_dir = unpacked_files[0] with open(os.path.join(bld_root, 'meson-info', 'intro-buildoptions.json'), encoding='utf-8') as boptions: meson_command += ['-D{name}={value}'.format(**o) for o in json.load(boptions) 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 |