diff options
author | Benjamin Peterson <benjamin@python.org> | 2013-05-12 03:24:28 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2013-05-12 03:24:28 (GMT) |
commit | 5a27168883523adba65b33482f4872d2e5d2e5f9 (patch) | |
tree | e2a247b83e551dc0c27df4b03039a02b43ea6afc /Lib/idlelib/run.py | |
parent | 6e165b40e13b30e722a0988108445b15fdaf8882 (diff) | |
download | cpython-5a27168883523adba65b33482f4872d2e5d2e5f9.zip cpython-5a27168883523adba65b33482f4872d2e5d2e5f9.tar.gz cpython-5a27168883523adba65b33482f4872d2e5d2e5f9.tar.bz2 |
prevent IDLE from trying to close when sys.stdin is reassigned (#17838)
Diffstat (limited to 'Lib/idlelib/run.py')
-rw-r--r-- | Lib/idlelib/run.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index e82ebf4c..9cc009f 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -264,6 +264,11 @@ class MyHandler(rpc.RPCHandler): IOBinding.encoding) sys.stderr = PyShell.PseudoOutputFile(self.console, "stderr", IOBinding.encoding) + + # 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) |