| 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') |