Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e7f5117

Browse files
committedFeb 10, 2025
Fix regular expression for variable splitting.
Previous code tried to escape every character, however python linters complained about illegal escapes. The expression also seemed a bit complex, so a character set seems clearer.
1 parent f7226c1 commit e7f5117

File tree

1 file changed

+1
-2
lines changed
  • scripts/py_matter_yamltests/matter_yamltests

1 file changed

+1
-2
lines changed
 

‎scripts/py_matter_yamltests/matter_yamltests/parser.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1225,8 +1225,7 @@ def _config_variable_substitution(self, value):
12251225
# But some other tests were relying on the fact that the expression was put 'as if' in
12261226
# the generated code and was resolved before being sent over the wire. For such
12271227
# expressions (e.g 'myVar + 1') we need to compute it before sending it over the wire.
1228-
delimiter_regex = "(\ |\(|\)|\+|\-|\*|\/|\%)"
1229-
tokens = re.split(delimiter_regex, value)
1228+
tokens = re.split("[- ()|+*/%]", value)
12301229
if len(tokens) == 0:
12311230
return value
12321231

0 commit comments

Comments
 (0)
Please sign in to comment.