| 230 | self._call(self._protocol.pipe_data_received, fd, data) |
| 231 | |
| 232 | def _process_exited(self, returncode): |
| 233 | assert returncode is not None, returncode |
| 234 | assert self._returncode is None, self._returncode |
| 235 | if self._loop.get_debug(): |
| 236 | logger.info('%r exited with return code %r', self, returncode) |
| 237 | self._returncode = returncode |
| 238 | if self._proc.returncode is None: |
| 239 | # asyncio uses a child watcher: copy the status into the Popen |
| 240 | # object. On Python 3.6, it is required to avoid a ResourceWarning. |
| 241 | self._proc.returncode = returncode |
| 242 | self._call(self._protocol.process_exited) |
| 243 | |
| 244 | self._try_finish() |
| 245 | |
| 246 | async def _wait(self): |
| 247 | """Wait until the process exit and return the process return code. |