diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2003-05-15 03:40:51 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2003-05-15 03:40:51 (GMT) |
commit | 5db4843c5e7d2b420b9ca9189b9e30669b62e55e (patch) | |
tree | 64f0c423f9f4ab56b1b59da326f9553bb2f68e54 | |
parent | 7f38ec0849fd2b19e660350c59d42b8b5cfae2d1 (diff) | |
download | cpython-5db4843c5e7d2b420b9ca9189b9e30669b62e55e.zip cpython-5db4843c5e7d2b420b9ca9189b9e30669b62e55e.tar.gz cpython-5db4843c5e7d2b420b9ca9189b9e30669b62e55e.tar.bz2 |
1. Make the startup more robust by not spawning the subprocess if IDLE
can't acquire the port to listen on.
2. Shorten the retry and simplify the messages.
-rw-r--r-- | Lib/idlelib/PyShell.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index f3312a8..6048503 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -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) |