mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #16706: get rid of os.error
This commit is contained in:
parent
a191959849
commit
ad28c7f9da
33 changed files with 4089 additions and 4123 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue