Remove implicit-optional assignment in `__init__` that cannot ever be true

IfClauseNode is only ever initialized in such a way that this attribute
is immediately set to something valid. And attempting to access its
value when the value is None would be a pretty broken error anyway. The
assignment served no purpose, but did perform a frivolous runtime op in
addition to angering mypy's checks for implicit None.
pull/12839/head
Eli Schwartz 11 months ago
parent fc41fd3542
commit 6f7e745052
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 1
      mesonbuild/mparser.py

@ -603,7 +603,6 @@ class IfClauseNode(BaseNode):
super().__init__(linenode.lineno, linenode.colno, linenode.filename)
self.ifs = []
self.elseblock = EmptyNode(linenode.lineno, linenode.colno, linenode.filename)
self.endif = None
@dataclass(unsafe_hash=True)
class TestCaseClauseNode(BaseNode):

Loading…
Cancel
Save