Commit 5a271688 authored by Benjamin Peterson's avatar Benjamin Peterson

prevent IDLE from trying to close when sys.stdin is reassigned (#17838)

parent 6e165b40
...@@ -264,6 +264,11 @@ class MyHandler(rpc.RPCHandler): ...@@ -264,6 +264,11 @@ class MyHandler(rpc.RPCHandler):
IOBinding.encoding) IOBinding.encoding)
sys.stderr = PyShell.PseudoOutputFile(self.console, "stderr", sys.stderr = PyShell.PseudoOutputFile(self.console, "stderr",
IOBinding.encoding) 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") self.interp = self.get_remote_proxy("interp")
rpc.RPCHandler.getresponse(self, myseq=None, wait=0.05) rpc.RPCHandler.getresponse(self, myseq=None, wait=0.05)
......
...@@ -122,6 +122,8 @@ Tests ...@@ -122,6 +122,8 @@ Tests
IDLE IDLE
---- ----
- Issue #17838: Allow sys.stdin to be reassigned.
- Issue #14735: Update IDLE docs to omit "Control-z on Windows". - Issue #14735: Update IDLE docs to omit "Control-z on Windows".
- Issue #17585: Fixed IDLE regression. Now closes when using exit() or quit(). - Issue #17585: Fixed IDLE regression. Now closes when using exit() or quit().
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment