From 3b2dde63180a52e2e6bacf58ff7e4c45d4a83237 Mon Sep 17 00:00:00 2001 From: Aditya Pande Date: Thu, 3 Aug 2023 12:03:44 -0700 Subject: [PATCH] Update python_expression.py Signed-off-by: Aditya Pande --- launch/launch/substitutions/python_expression.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/launch/launch/substitutions/python_expression.py b/launch/launch/substitutions/python_expression.py index 5e69e785b..3ee4fe957 100644 --- a/launch/launch/substitutions/python_expression.py +++ b/launch/launch/substitutions/python_expression.py @@ -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]: