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

Method _capture

Lib/test/test_interpreters/utils.py:240–257  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

238 self._rf_exc = None
239
240 def _capture(self):
241 # Ideally this is called only after the script finishes
242 # (and thus has closed the write end of the pipe.
243 if self._rf_out is not None:
244 chunk = self._rf_out.read(100)
245 while chunk:
246 self._buf_out += chunk
247 chunk = self._rf_out.read(100)
248 if self._rf_err is not None:
249 chunk = self._rf_err.read(100)
250 while chunk:
251 self._buf_err += chunk
252 chunk = self._rf_err.read(100)
253 if self._rf_exc is not None:
254 chunk = self._rf_exc.read(100)
255 while chunk:
256 self._buf_exc += chunk
257 chunk = self._rf_exc.read(100)
258
259 def _unpack_stdout(self):
260 return self._buf_out.decode('utf-8')

Callers 4

closeMethod · 0.95
stdoutMethod · 0.95
stderrMethod · 0.95
excMethod · 0.95

Calls 1

readMethod · 0.45

Tested by

no test coverage detected