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

Method _connect_pipes

Lib/asyncio/base_subprocess.py:180–217  ·  view source on GitHub ↗
(self, waiter)

Source from the content-addressed store, hash-verified

178 self.send_signal(signal.SIGKILL)
179
180 async def _connect_pipes(self, waiter):
181 try:
182 proc = self._proc
183 loop = self._loop
184
185 if proc.stdin is not None:
186 _, pipe = await loop.connect_write_pipe(
187 lambda: WriteSubprocessPipeProto(self, 0),
188 proc.stdin)
189 self._pipes[0] = pipe
190
191 if proc.stdout is not None:
192 _, pipe = await loop.connect_read_pipe(
193 lambda: ReadSubprocessPipeProto(self, 1),
194 proc.stdout)
195 self._pipes[1] = pipe
196
197 if proc.stderr is not None:
198 _, pipe = await loop.connect_read_pipe(
199 lambda: ReadSubprocessPipeProto(self, 2),
200 proc.stderr)
201 self._pipes[2] = pipe
202
203 assert self._pending_calls is not None
204
205 loop.call_soon(self._protocol.connection_made, self)
206 for callback, data in self._pending_calls:
207 loop.call_soon(callback, *data)
208 self._pending_calls = None
209 except (SystemExit, KeyboardInterrupt):
210 raise
211 except BaseException as exc:
212 if waiter is not None and not waiter.cancelled():
213 waiter.set_exception(exc)
214 else:
215 if waiter is not None and not waiter.cancelled():
216 waiter.set_result(None)
217 self._pipes_connected = True
218
219 def _call(self, cb, *data):
220 if self._pending_calls is not None:

Callers 1

__init__Method · 0.95

Calls 8

connect_write_pipeMethod · 0.45
connect_read_pipeMethod · 0.45
call_soonMethod · 0.45
cancelledMethod · 0.45
set_exceptionMethod · 0.45
set_resultMethod · 0.45

Tested by

no test coverage detected