Skip to content

Commit 3638961

Browse files
committed
[OMCSessionZMQ] verify that _omc is not None before trying to close it
1 parent 1bbe520 commit 3638961

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

OMPython/OMCSession.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,9 @@ def sendExpression(self, command, parsed=True):
541541
raise OMCSessionException(f"No connection with OMC (timeout={self._timeout}). Log-file says: \n{log}")
542542
time.sleep(self._timeout / 50.0)
543543
if command == "quit()":
544-
self._omc.close()
545-
self._omc = None
544+
if self._omc is not None:
545+
self._omc.close()
546+
self._omc = None
546547
return None
547548
else:
548549
result = self._omc.recv_string()

0 commit comments

Comments
 (0)