[Python-checkins] cpython (3.3): #17585: Fixed IDLE regression. Now closes when using exit() or quit().

roger.serwy python-checkins at python.org
Fri Apr 12 02:24:20 CEST 2013


http://hg.python.org/cpython/rev/d3c67e2fc68c
changeset:   83259:d3c67e2fc68c
branch:      3.3
parent:      83252:bc514cc5d65b
user:        Roger Serwy <roger.serwy at gmail.com>
date:        Thu Apr 11 19:16:44 2013 -0500
summary:
  #17585: Fixed IDLE regression. Now closes when using exit() or quit().

files:
  Lib/idlelib/PyShell.py |  3 +++
  Lib/site.py            |  7 +------
  Misc/NEWS              |  2 ++
  3 files changed, 6 insertions(+), 6 deletions(-)


diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -1365,6 +1365,9 @@
         self._line_buffer = line[size:]
         return line[:size]
 
+    def close(self):
+        self.shell.close()
+
 
 usage_msg = """\
 
diff --git a/Lib/site.py b/Lib/site.py
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -369,12 +369,7 @@
             # 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)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -46,6 +46,8 @@
 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.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list