Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1eafd10

Browse files
committed
#17585: Fixed IDLE regression. Now closes when using exit() or quit().
1 parent 36b045f commit 1eafd10

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

Lib/idlelib/PyShell.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,6 +1365,9 @@ def readline(self, size=-1):
13651365
self._line_buffer = line[size:]
13661366
return line[:size]
13671367

1368+
def close(self):
1369+
self.shell.close()
1370+
13681371

13691372
usage_msg = """\
13701373

Lib/site.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,7 @@ def __call__(self, code=None):
369369
# Shells like IDLE catch the SystemExit, but listen when their
370370
# stdin wrapper is closed.
371371
try:
372-
fd = -1
373-
if hasattr(sys.stdin, "fileno"):
374-
fd = sys.stdin.fileno()
375-
if fd != 0:
376-
# Don't close stdin if it wraps fd 0
377-
sys.stdin.close()
372+
sys.stdin.close()
378373
except:
379374
pass
380375
raise SystemExit(code)

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ Library
4646
IDLE
4747
----
4848

49+
- Issue #17585: Fixed IDLE regression. Now closes when using exit() or quit().
50+
4951
- Issue #17657: Show full Tk version in IDLE's about dialog.
5052
Patch by Todd Rovito.
5153

0 commit comments

Comments
 (0)