From 935ea9a0b291b2ce42a5cf02d9f2f2955e21a6aa Mon Sep 17 00:00:00 2001 From: "Kurt B. Kaiser" Date: Tue, 10 May 2005 03:44:24 +0000 Subject: Improve subprocess link error notification M NEWS.txt M PyShell.py M rpc.py --- Lib/idlelib/NEWS.txt | 2 ++ Lib/idlelib/PyShell.py | 3 +++ Lib/idlelib/rpc.py | 7 ++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index afec8e4..03ba114 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,6 +3,8 @@ What's New in IDLE 1.2a0? *Release date: XX-XXX-2005* +- Improve subprocess link error notification. + - run.py: use Queue's blocking feature instead of sleeping in the main loop. Patch # 1190163 Michiel de Hoon diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index fecbf1a..fa348be 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -596,6 +596,8 @@ class ModifiedInterpreter(InteractiveInterpreter): self.write("Unsupported characters in input") return try: + # InteractiveInterpreter.runsource() calls its runcode() method, + # which is overridden (see below) return InteractiveInterpreter.runsource(self, source, filename) finally: if self.save_warnings_filters is not None: @@ -720,6 +722,7 @@ class ModifiedInterpreter(InteractiveInterpreter): else: self.showtraceback() except: + print>>sys.stderr, "IDLE internal error in runcode()" self.showtraceback() finally: if not use_subprocess: diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py index 402cfa7..3bac6a3 100644 --- a/Lib/idlelib/rpc.py +++ b/Lib/idlelib/rpc.py @@ -330,9 +330,10 @@ class SocketIO(object): try: r, w, x = select.select([], [self.sock], []) n = self.sock.send(s[:BUFSIZE]) - except (AttributeError, socket.error): - # socket was closed - raise IOError + except (AttributeError, TypeError): + raise IOError, "socket no longer exists" + except socket.error: + raise else: s = s[n:] -- cgit v0.12