File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -556,6 +556,7 @@ def _connect_to_omc(self, timeout):
556
556
import zmq
557
557
context = zmq .Context .instance ()
558
558
self ._omc = context .socket (zmq .REQ )
559
+ self ._omc .setsockopt (zmq .LINGER , 0 ) # Dismisses pending messages if closed
559
560
self ._omc .connect (self ._port )
560
561
561
562
def execute (self , command ):
@@ -575,12 +576,12 @@ def execute(self, command):
575
576
def sendExpression (self , command , parsed = True ):
576
577
if self ._omc is not None :
577
578
self ._omc .send_string (str (command ))
578
- result = self ._omc .recv_string ()
579
579
if command == "quit()" :
580
580
self ._omc .close ()
581
581
self ._omc = None
582
- return result
582
+ return "Force quit"
583
583
else :
584
+ result = self ._omc .recv_string ()
584
585
if parsed is True :
585
586
answer = OMTypedParser .parseString (result )
586
587
return answer
You can’t perform that action at this time.
0 commit comments