mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
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.
This commit is contained in:
parent
2b477565ad
commit
7c22132069
2 changed files with 4 additions and 4 deletions
|
|
@ -240,9 +240,9 @@ def _getresponse(self, myseq):
|
|||
self.debug("_getresponse:myseq:", myseq)
|
||||
if threading.currentThread() is self.mainthread:
|
||||
# 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:
|
||||
response = self.pollresponse(myseq, None)
|
||||
response = self.pollresponse(myseq, wait=None)
|
||||
if response is not None:
|
||||
return response
|
||||
else:
|
||||
|
|
@ -346,7 +346,7 @@ def pollresponse(self, myseq, wait=0.0):
|
|||
message = self.pollmessage(wait)
|
||||
if message is None: # socket not ready
|
||||
return None
|
||||
wait = 0.0
|
||||
#wait = 0.0 # poll on subsequent passes instead of blocking
|
||||
seq, resq = message
|
||||
self.debug("pollresponse:%d:myseq:%s" % (seq, myseq))
|
||||
if resq[0] == "call":
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ def flush_stdout(self):
|
|||
if sys.stdout.softspace:
|
||||
sys.stdout.softspace = 0
|
||||
sys.stdout.write("\n")
|
||||
except AttributeError:
|
||||
except (AttributeError, EOFError):
|
||||
pass
|
||||
|
||||
def cleanup_traceback(self, tb, exclude):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue