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

Method communicate

Lib/asyncio/subprocess.py:188–203  ·  view source on GitHub ↗
(self, input=None)

Source from the content-addressed store, hash-verified

186 return output
187
188 async def communicate(self, input=None):
189 if self.stdin is not None:
190 stdin = self._feed_stdin(input)
191 else:
192 stdin = self._noop()
193 if self.stdout is not None:
194 stdout = self._read_stream(1)
195 else:
196 stdout = self._noop()
197 if self.stderr is not None:
198 stderr = self._read_stream(2)
199 else:
200 stderr = self._noop()
201 stdin, stdout, stderr = await tasks.gather(stdin, stdout, stderr)
202 await self.wait()
203 return (stdout, stderr)
204
205
206async def create_subprocess_shell(cmd, stdin=None, stdout=None, stderr=None,

Callers 15

get_outputMethod · 0.45
test_envMethod · 0.45
test_empty_envMethod · 0.45
test_invalid_envMethod · 0.45
test_send_signalMethod · 0.45
test_killMethod · 0.45
test_terminateMethod · 0.45

Calls 5

_feed_stdinMethod · 0.95
_noopMethod · 0.95
_read_streamMethod · 0.95
waitMethod · 0.95
gatherMethod · 0.45

Tested by 15

get_outputMethod · 0.36
test_envMethod · 0.36
test_empty_envMethod · 0.36
test_invalid_envMethod · 0.36
test_send_signalMethod · 0.36
test_killMethod · 0.36
test_terminateMethod · 0.36