Commit eb20bf23 authored by Kurt B. Kaiser's avatar Kurt B. Kaiser

M rpc.py

M run.py
1. Clarify that rpc.SocketIO._getresponse() currently blocks on socket.
2. Improve exception handling in subprocess when GUI terminates abruptly.
parent 544c2670
...@@ -240,9 +240,9 @@ class SocketIO: ...@@ -240,9 +240,9 @@ class SocketIO:
self.debug("_getresponse:myseq:", myseq) self.debug("_getresponse:myseq:", myseq)
if threading.currentThread() is self.mainthread: if threading.currentThread() is self.mainthread:
# Main thread: does all reading of requests or responses # Main thread: does all reading of requests or responses
# Loop here until there is message traffic on the socket # Loop here, blocking each time until socket is ready.
while 1: while 1:
response = self.pollresponse(myseq, None) response = self.pollresponse(myseq, wait=None)
if response is not None: if response is not None:
return response return response
else: else:
...@@ -346,7 +346,7 @@ class SocketIO: ...@@ -346,7 +346,7 @@ class SocketIO:
message = self.pollmessage(wait) message = self.pollmessage(wait)
if message is None: # socket not ready if message is None: # socket not ready
return None return None
wait = 0.0 #wait = 0.0 # poll on subsequent passes instead of blocking
seq, resq = message seq, resq = message
self.debug("pollresponse:%d:myseq:%s" % (seq, myseq)) self.debug("pollresponse:%d:myseq:%s" % (seq, myseq))
if resq[0] == "call": if resq[0] == "call":
......
...@@ -92,7 +92,7 @@ class Executive: ...@@ -92,7 +92,7 @@ class Executive:
if sys.stdout.softspace: if sys.stdout.softspace:
sys.stdout.softspace = 0 sys.stdout.softspace = 0
sys.stdout.write("\n") sys.stdout.write("\n")
except AttributeError: except (AttributeError, EOFError):
pass pass
def cleanup_traceback(self, tb, exclude): def cleanup_traceback(self, tb, exclude):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment