MCPcopy Index your code
hub / github.com/python/cpython / _start

Method _start

Lib/asyncio/unix_events.py:835–854  ·  view source on GitHub ↗
(self, args, shell, stdin, stdout, stderr, bufsize, **kwargs)

Source from the content-addressed store, hash-verified

833class _UnixSubprocessTransport(base_subprocess.BaseSubprocessTransport):
834
835 def _start(self, args, shell, stdin, stdout, stderr, bufsize, **kwargs):
836 stdin_w = None
837 if stdin == subprocess.PIPE and sys.platform.startswith('aix'):
838 # Use a socket pair for stdin on AIX, since it does not
839 # support selecting read events on the write end of a
840 # socket (which we use in order to detect closing of the
841 # other end).
842 stdin, stdin_w = socket.socketpair()
843 try:
844 self._proc = subprocess.Popen(
845 args, shell=shell, stdin=stdin, stdout=stdout, stderr=stderr,
846 universal_newlines=False, bufsize=bufsize, **kwargs)
847 if stdin_w is not None:
848 stdin.close()
849 self._proc.stdin = open(stdin_w.detach(), 'wb', buffering=bufsize)
850 stdin_w = None
851 finally:
852 if stdin_w is not None:
853 stdin.close()
854 stdin_w.close()
855
856
857class _PidfdChildWatcher:

Callers

nothing calls this directly

Calls 5

openFunction · 0.50
startswithMethod · 0.45
socketpairMethod · 0.45
closeMethod · 0.45
detachMethod · 0.45

Tested by

no test coverage detected