diff options
author | Roger Serwy <roger.serwy@gmail.com> | 2013-04-12 00:18:22 (GMT) |
---|---|---|
committer | Roger Serwy <roger.serwy@gmail.com> | 2013-04-12 00:18:22 (GMT) |
commit | 663a3904545f709e7af5b4a122c2e9d01b07fef6 (patch) | |
tree | b91f81bd4ff8ed92cb9735c2fa0959af19e3a92e /Lib | |
parent | f1c42538e4d69b1b354ce3c0aa7b6cd6a013fd84 (diff) | |
parent | 1eafd1076eca6b63337a2d8bb1eecae5b57e7792 (diff) | |
download | cpython-663a3904545f709e7af5b4a122c2e9d01b07fef6.zip cpython-663a3904545f709e7af5b4a122c2e9d01b07fef6.tar.gz cpython-663a3904545f709e7af5b4a122c2e9d01b07fef6.tar.bz2 |
#17585: merge with 3.3.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/idlelib/PyShell.py | 3 | ||||
-rw-r--r-- | Lib/site.py | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index b1ef4ca..13dd8e1 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -1368,6 +1368,9 @@ class PseudoInputFile(PseudoFile): 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 index acaeb3e..a954704 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -350,12 +350,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) |