summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2013-05-12 03:24:28 (GMT)
committerBenjamin Peterson <benjamin@python.org>2013-05-12 03:24:28 (GMT)
commit0d4931eb9e35a37ea8b116b408082326a80c16c2 (patch)
tree36117435f8a6cad16bdf1ade940dc816d231b477 /Lib/idlelib
parent81641d6ebc0a184e10e2770587f37ad853cd134b (diff)
downloadcpython-0d4931eb9e35a37ea8b116b408082326a80c16c2.zip
cpython-0d4931eb9e35a37ea8b116b408082326a80c16c2.tar.gz
cpython-0d4931eb9e35a37ea8b116b408082326a80c16c2.tar.bz2
prevent IDLE from trying to close when sys.stdin is reassigned (#17838)
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/run.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
index d105912..88da23b 100644
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -297,6 +297,11 @@ class MyHandler(rpc.RPCHandler):
# page help() text to shell.
import pydoc # import must be done here to capture i/o binding
pydoc.pager = pydoc.plainpager
+
+ # Keep a reference to stdin so that it won't try to exit IDLE if
+ # sys.stdin gets changed from within IDLE's shell. See issue17838.
+ self._keep_stdin = sys.stdin
+
self.interp = self.get_remote_proxy("interp")
rpc.RPCHandler.getresponse(self, myseq=None, wait=0.05)