summaryrefslogtreecommitdiff
path: root/Lib/site.py
diff options
context:
space:
mode:
authorRoger Serwy <roger.serwy@gmail.com>2013-04-11 19:16:44 -0500
committerRoger Serwy <roger.serwy@gmail.com>2013-04-11 19:16:44 -0500
commit1eafd1076eca6b63337a2d8bb1eecae5b57e7792 (patch)
treeb0af393497b95bda3a1bdc0efe33be5d20132e02 /Lib/site.py
parent36b045f4db128a308f311058330c81995acf68fe (diff)
downloadcpython-git-1eafd1076eca6b63337a2d8bb1eecae5b57e7792.tar.gz
#17585: Fixed IDLE regression. Now closes when using exit() or quit().
Diffstat (limited to 'Lib/site.py')
-rw-r--r--Lib/site.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/Lib/site.py b/Lib/site.py
index b751006c88..87687e7a1b 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -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)