]> granicus.if.org Git - python/commitdiff
M rpc.py
authorKurt B. Kaiser <kbk@shore.net>
Tue, 11 Mar 2003 22:55:56 +0000 (22:55 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Tue, 11 Mar 2003 22:55:56 +0000 (22:55 +0000)
M run.py
1. Clarify that rpc.SocketIO._getresponse() currently blocks on socket.
2. Improve exception handling in subprocess when GUI terminates abruptly.

Lib/idlelib/rpc.py
Lib/idlelib/run.py

index 2939f5fa83bf9f12b41cc18dfea1b68f3fb3f8fa..9895ac8869c869efa9cf35039dbe7755af43d305 100644 (file)
@@ -240,9 +240,9 @@ class SocketIO:
         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 @@ class SocketIO:
             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":
index 6ab80444de51e1395427973746233f46428728be..d79f3d73d0cf848c0381c73d74d9ecc477415e91 100644 (file)
@@ -92,7 +92,7 @@ class Executive:
             if sys.stdout.softspace:
                 sys.stdout.softspace = 0
                 sys.stdout.write("\n")
-        except AttributeError:
+        except (AttributeError, EOFError):
             pass
 
     def cleanup_traceback(self, tb, exclude):