MCPcopy Index your code
hub / github.com/RustPython/RustPython / _open_terminal

Function _open_terminal

Lib/pty.py:57–67  ·  view source on GitHub ↗

Open pty master and return (master_fd, tty_name).

()

Source from the content-addressed store, hash-verified

55 return _open_terminal()
56
57def _open_terminal():
58 """Open pty master and return (master_fd, tty_name)."""
59 for x in 'pqrstuvwxyzPQRST':
60 for y in '0123456789abcdef':
61 pty_name = '/dev/pty' + x + y
62 try:
63 fd = os.open(pty_name, os.O_RDWR)
64 except OSError:
65 continue
66 return (fd, '/dev/tty' + x + y)
67 raise OSError('out of pty devices')
68
69def slave_open(tty_name):
70 """slave_open(tty_name) -> slave_fd

Callers 2

openptyFunction · 0.85
master_openFunction · 0.85

Calls 1

openMethod · 0.45

Tested by

no test coverage detected