MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _open_terminal

Function _open_terminal

tools/python-3.11.9-amd64/Lib/pty.py:54–64  ·  view source on GitHub ↗

Open pty master and return (master_fd, tty_name).

()

Source from the content-addressed store, hash-verified

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