diff options
Diffstat (limited to 'Lib/pty.py')
-rw-r--r-- | Lib/pty.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -57,17 +57,17 @@ def _open_terminal(): try: tty_name, master_fd = sgi._getpty(os.O_RDWR, 0o666, 0) except IOError as msg: - raise os.error(msg) + raise OSError(msg) return master_fd, tty_name for x in 'pqrstuvwxyzPQRST': for y in '0123456789abcdef': pty_name = '/dev/pty' + x + y try: fd = os.open(pty_name, os.O_RDWR) - except os.error: + except OSError: continue return (fd, '/dev/tty' + x + y) - raise os.error('out of pty devices') + raise OSError('out of pty devices') def slave_open(tty_name): """slave_open(tty_name) -> slave_fd @@ -178,3 +178,4 @@ def spawn(argv, master_read=_read, stdin_read=_read): tty.tcsetattr(STDIN_FILENO, tty.TCSAFLUSH, mode) os.close(master_fd) + return os.waitpid(pid, 0)[1] |