MCPcopy
hub / github.com/pex-tool/pex / communicate

Method communicate

pex/jobs.py:121–135  ·  view source on GitHub ↗

Communicates with the job sending any input data to stdin and collecting stdout and stderr. :param input: Data to send to stdin of the job as per the `subprocess` API. :return: A tuple of the job's stdout and stderr as per the `subprocess` API. :raises: :class:`Job.E

(self, input=None)

Source from the content-addressed store, hash-verified

119 self._finalize_job()
120
121 def communicate(self, input=None):
122 # type: (Optional[bytes]) -> Tuple[bytes, bytes]
123 """Communicates with the job sending any input data to stdin and collecting stdout and
124 stderr.
125
126 :param input: Data to send to stdin of the job as per the `subprocess` API.
127 :return: A tuple of the job's stdout and stderr as per the `subprocess` API.
128 :raises: :class:`Job.Error` if the job exited non-zero.
129 """
130 try:
131 stdout, stderr = self._process.communicate(input=input)
132 self._check_returncode(stderr)
133 return stdout, stderr
134 finally:
135 self._finalize_job()
136
137 def kill(self):
138 # type: () -> None

Callers 15

add_git_stateFunction · 0.80
is_aliveFunction · 0.80
from_envMethod · 0.80
executeMethod · 0.80
findMethod · 0.80
__get__Method · 0.80
waitMethod · 0.80
await_resultMethod · 0.80
await_resultMethod · 0.80
install_wheelFunction · 0.80
createMethod · 0.80
buildFunction · 0.80

Calls 2

_check_returncodeMethod · 0.95
_finalize_jobMethod · 0.95