]> granicus.if.org Git - python/commitdiff
1. Make the startup more robust by not spawning the subprocess if IDLE
authorKurt B. Kaiser <kbk@shore.net>
Thu, 15 May 2003 03:40:51 +0000 (03:40 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Thu, 15 May 2003 03:40:51 +0000 (03:40 +0000)
   can't acquire the port to listen on.
2. Shorten the retry and simplify the messages.

Lib/idlelib/PyShell.py

index f3312a83c36e927db93afa9dd5c144c602991b38..604850378149a5178a88e2b6d6c679042c436439 100644 (file)
@@ -325,22 +325,19 @@ class ModifiedInterpreter(InteractiveInterpreter):
 
     def start_subprocess(self):
         addr = ("localhost", self.port)
-        self.spawn_subprocess()
         # Idle starts listening for connection on localhost
-        for i in range(6):
+        for i in range(3):
             time.sleep(i)
             try:
                 self.rpcclt = rpc.RPCClient(addr)
                 break
             except socket.error, err:
-                if i < 3:
-                    print>>sys.__stderr__, ". ",
-                else:
-                    print>>sys.__stderr__,"\nIdle socket error: " + err[1]\
+                print>>sys.__stderr__,"Idle socket error: " + err[1]\
                                                     + ", retrying..."
         else:
             display_port_binding_error()
             sys.exit()
+        self.spawn_subprocess()
         # Accept the connection from the Python execution server
         self.rpcclt.accept()
         self.rpcclt.register("stdin", self.tkconsole)