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

Function master_open

Lib/pty.py:38–55  ·  view source on GitHub ↗

master_open() -> (master_fd, slave_name) Open a pty master and return the fd, and the filename of the slave end. Deprecated, use openpty() instead.

()

Source from the content-addressed store, hash-verified

36 return master_fd, slave_fd
37
38def master_open():
39 """master_open() -> (master_fd, slave_name)
40 Open a pty master and return the fd, and the filename of the slave end.
41 Deprecated, use openpty() instead."""
42
43 import warnings
44 warnings.warn("Use pty.openpty() instead.", DeprecationWarning, stacklevel=2) # Remove API in 3.14
45
46 try:
47 master_fd, slave_fd = os.openpty()
48 except (AttributeError, OSError):
49 pass
50 else:
51 slave_name = os.ttyname(slave_fd)
52 os.close(slave_fd)
53 return master_fd, slave_name
54
55 return _open_terminal()
56
57def _open_terminal():
58 """Open pty master and return (master_fd, tty_name)."""

Callers

nothing calls this directly

Calls 3

_open_terminalFunction · 0.85
warnMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected