diff -r abbbe1f90635 Lib/site.py --- a/Lib/site.py Sun Mar 31 01:11:26 2013 -0500 +++ b/Lib/site.py Sun Mar 31 14:27:02 2013 -0500 @@ -350,12 +350,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)