Commits

Benjamin Peterson  committed 4b3d181

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

  • Participants
  • Parent commits abc7803
  • Branches 2.7

Comments (0)

Files changed (2)

File Lib/idlelib/run.py

                 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)
 
 IDLE
 ----
 
+- Issue #17838: Allow sys.stdin to be reassigned.
+
 - Issue #14735: Update IDLE docs to omit "Control-z on Windows".
 
 - Issue #17585: Fixed IDLE regression. Now closes when using exit() or quit().