diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index 36d9f6574..8fc198290 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -1714,7 +1714,9 @@ class ExternalProgram: break if not silent: - if self.found(): + # ignore the warning because derived classes never call this __init__ + # method, and thus only the found() method of this class is ever executed + if self.found(): # lgtm [py/init-calls-subclass] mlog.log('Program', mlog.bold(name), 'found:', mlog.green('YES'), '(%s)' % ' '.join(self.command)) else: diff --git a/mesonbuild/rewriter.py b/mesonbuild/rewriter.py index 3712c075f..5078d3c73 100644 --- a/mesonbuild/rewriter.py +++ b/mesonbuild/rewriter.py @@ -103,11 +103,11 @@ class RequiredKeys: class MTypeBase: def __init__(self, node: Optional[BaseNode] = None): if node is None: - self.node = self._new_node() + self.node = self._new_node() # lgtm [py/init-calls-subclass] (node creation does not depend on base class state) else: self.node = node self.node_type = None - for i in self.supported_nodes(): + for i in self.supported_nodes(): # lgtm [py/init-calls-subclass] (listing nodes does not depend on base class state) if isinstance(self.node, i): self.node_type = i