Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Matthijs van der Burgh <[email protected]>
  • Loading branch information
MatthijsBurgh authored Mar 20, 2024
1 parent 048c825 commit d37fb87
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions launch/launch/substitutions/boolean_substitution.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __init__(self, func: Callable[[bool, bool], bool], left: SomeSubstitutionsTy
def parse(cls, data: Sequence[SomeSubstitutionsType]):
"""Parse `AndSubstitution` substitution."""
if len(data) != 2:
raise TypeError(f'{self.__class__.__name__} expects 2 arguments')
raise TypeError(f'{cls.__name__} expects 2 arguments')
return cls, {'left': data[0], 'right': data[1]}

@property
Expand All @@ -106,11 +106,11 @@ def describe(self) -> Text:
def perform(self, context: LaunchContext) -> Text:
"""Perform the substitution."""
try:
left_condition: bool = perform_typed_substitution(context, self.left, bool)
left_condition = perform_typed_substitution(context, self.left, bool)
except (TypeError, ValueError) as e:
raise SubstitutionFailure(e)
try:
right_condition: bool = perform_typed_substitution(context, self.right, bool)
right_condition = perform_typed_substitution(context, self.right, bool)
except (TypeError, ValueError) as e:
raise SubstitutionFailure(e)

Expand Down

0 comments on commit d37fb87

Please sign in to comment.