]> granicus.if.org Git - python/commitdiff
#17585: Fixed IDLE regression. Now closes when using exit() or quit().
authorRoger Serwy <roger.serwy@gmail.com>
Fri, 12 Apr 2013 00:16:44 +0000 (19:16 -0500)
committerRoger Serwy <roger.serwy@gmail.com>
Fri, 12 Apr 2013 00:16:44 +0000 (19:16 -0500)
Lib/idlelib/PyShell.py
Lib/site.py
Misc/NEWS

index c381f23b1e2c7e5296444200e1c91afb10dac434..177e49e55e461887b0144a8946e7b8059fb1103a 100644 (file)
@@ -1365,6 +1365,9 @@ class PseudoInputFile(PseudoFile):
         self._line_buffer = line[size:]
         return line[:size]
 
+    def close(self):
+        self.shell.close()
+
 
 usage_msg = """\
 
index b751006c88e85ae8ed90f1d15de59430add8bc15..87687e7a1b6a2edc36496c610836fee3d2158315 100644 (file)
@@ -369,12 +369,7 @@ def setquit():
             # Shells like IDLE catch the SystemExit, but listen when their
             # stdin wrapper is closed.
             try:
-                fd = -1
-                if hasattr(sys.stdin, "fileno"):
-                    fd = sys.stdin.fileno()
-                if fd != 0:
-                    # Don't close stdin if it wraps fd 0
-                    sys.stdin.close()
+                sys.stdin.close()
             except:
                 pass
             raise SystemExit(code)
index b8f687b55695bec7dc29a9a3825f6ec96ab0eb5c..ddfc7011983bb0ecf6e334d65fce1dd765f4e9b4 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -46,6 +46,8 @@ Library
 IDLE
 ----
 
+- Issue #17585: Fixed IDLE regression. Now closes when using exit() or quit().
+
 - Issue #17657: Show full Tk version in IDLE's about dialog.
   Patch by Todd Rovito.