Skip to content

Commit 2ad8cf6

Browse files
committed
Fix: Improve regex to handle escaped quotes in OMC error messages and possible negative id
1 parent 9ea7b19 commit 2ad8cf6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

OMPython/OMCSession.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -903,10 +903,10 @@ def sendExpression(self, command: str, parsed: bool = True) -> Any:
903903
r"\s*lineEnd = (\d+),\n"
904904
r"\s*columnEnd = (\d+)\n"
905905
r"\s*end OpenModelica\.Scripting\.SourceInfo;,\n"
906-
r"\s*message = \"(.*?)\",\n" # message
906+
r"\s*message = \"(.*)\",\n" # message
907907
r"\s*kind = \.OpenModelica\.Scripting\.ErrorKind\.(.*?),\n" # kind
908908
r"\s*level = \.OpenModelica\.Scripting\.ErrorLevel\.(.*?),\n" # level
909-
r"\s*id = (\d+)", # id
909+
r"\s*id = (-?\d+)", # id
910910
flags=re.MULTILINE | re.DOTALL)
911911

912912
# extract all ErrorMessage records

0 commit comments

Comments
 (0)