summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/PyShell.py5
-rw-r--r--Lib/idlelib/rpc.py2
2 files changed, 6 insertions, 1 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index 946e0b2..0c9fbfb 100644
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -400,7 +400,10 @@ class ModifiedInterpreter(InteractiveInterpreter):
from signal import SIGINT
except ImportError:
SIGINT = 2
- os.kill(self.rpcpid, SIGINT)
+ try:
+ os.kill(self.rpcpid, SIGINT)
+ except OSError: # subprocess may have already exited
+ pass
def __request_interrupt(self):
self.rpcclt.asynccall("exec", "interrupt_the_server", (), {})
diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py
index 54455a2..2939f5f 100644
--- a/Lib/idlelib/rpc.py
+++ b/Lib/idlelib/rpc.py
@@ -166,6 +166,8 @@ class SocketIO:
return ("OK", ret)
except SystemExit:
raise
+ except socket.error:
+ pass
except:
self.debug("localcall:EXCEPTION")
traceback.print_exc(file=sys.__stderr__)