Skip to content

Commit

Permalink
Update python_expression.py
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapande-1995 authored Aug 3, 2023
1 parent b7c735c commit 7a47306
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions launch/launch/substitutions/python_expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,9 @@ def __init__(self, expression: SomeSubstitutionsType) -> None:
@classmethod
def parse(cls, data: Iterable[SomeSubstitutionsType]):
"""Parse `PythonExpression` substitution."""
<<<<<<< HEAD
if len(data) != 1:
raise TypeError('eval substitution expects 1 argument')
return cls, {'expression': data[0]}
=======
if len(data) < 1 or len(data) > 2:
raise TypeError('eval substitution expects 1 or 2 arguments')
kwargs = {}
kwargs['expression'] = data[0]
if len(data) == 2:
# We get a text substitution from XML,
# whose contents are comma-separated module names
kwargs['python_modules'] = []
# Check if we got empty list from XML
if len(data[1]) > 0:
modules_str = data[1][0].perform(None)
kwargs['python_modules'] = [module.strip() for module in modules_str.split(',')]
return cls, kwargs
>>>>>>> 2a84352 (Fixed typos (#692))

@property
def expression(self) -> List[Substitution]:
Expand Down

0 comments on commit 7a47306

Please sign in to comment.