File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -556,6 +556,7 @@ def _connect_to_omc(self, timeout):
556556 import zmq
557557 context = zmq .Context .instance ()
558558 self ._omc = context .socket (zmq .REQ )
559+ self ._omc .setsockopt (zmq .LINGER , 0 ) # Dismisses pending messages if closed
559560 self ._omc .connect (self ._port )
560561
561562 def execute (self , command ):
@@ -575,12 +576,12 @@ def execute(self, command):
575576 def sendExpression (self , command , parsed = True ):
576577 if self ._omc is not None :
577578 self ._omc .send_string (str (command ))
578- result = self ._omc .recv_string ()
579579 if command == "quit()" :
580580 self ._omc .close ()
581581 self ._omc = None
582- return result
582+ return "Force quit"
583583 else :
584+ result = self ._omc .recv_string ()
584585 if parsed is True :
585586 answer = OMTypedParser .parseString (result )
586587 return answer
You can’t perform that action at this time.
0 commit comments