Skip to content

Commit eea8975

Browse files
committed
[OMCPathReal] fix flake8
OMPython/OMCSession.py:339:110: E999 SyntaxError: f-string: unmatched '('
1 parent 0697840 commit eea8975

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

OMPython/OMCSession.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@ def write_text(self, data: str, encoding=None, errors=None, newline=None):
335335
if not isinstance(data, str):
336336
raise TypeError(f"data must be str, not {data.__class__.__name__}")
337337

338-
self._session.sendExpression(f'writeFile("{self.as_posix()}", "{data.replace('"', '\\"')}", false);')
338+
data_omc = data.replace('"', '\\"')
339+
self._session.sendExpression(f'writeFile("{self.as_posix()}", "{data_omc}", false);')
339340

340341
return len(data)
341342

0 commit comments

Comments
 (0)